Arm FF-A fixes for v5.14
A small set of fixes: - adding check for presence of probe while registering the driver to prevent NULL pointer access - dropping the duplicate check as the driver core already takes care of it - fixing possible ffa_linux_errmap buffer overflow and - fixing kernel-doc warning for comment style -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmDvD+8ACgkQAEG6vDF+ 4pgdARAAmNyU9R8vhDE46x4cTygP6QSTJHQXXjmpjdkmrJi5q3i0M+LkHPwfoHQT nNLqhSTm7u08Zh2na9mJvr4uLl3VctKZ2hMX8q+0CQL7eIGKAfS+/hq4TamOJylk sNhiZe73FrPHeR6pBD2kCeNzIhP9vsIsMhSzo0hAmQRbXyCjBuafIsZxJRluGDyF /GspA95uDcJuazi/mm2XOT0mxVTG5rp3+LBpeYV7rD2FYxZ3nWkbmW37lWhyO7wV Qww6+UqJOuvho0CEHWCbqUK7NHa8RBI2Wut9TVcARvQLK8yYhh83UrDX5x+M2f7z oEPL6hHrdeQNZviUs0lu9GWHESHA/vvWa8LX9IKiBazQGsIK6PZArF8KJtoT88oK QZHGVziz7sNIesDQzx9Yhek8pKxmdTWHa0MGYCRjlm+gLU73KY1zAxurXrCXzkQp qarI7fzGbcvFEFPb9YEaqA+LyPtpkaALo1chu+fsEg6Gla2kY+gxfmh5bNiUFDJK nexEDaY0aba7WNG32KMVDMSDheHkBvfsjd8FM7OIYBMg7rUvEuQ37X5993UVSymZ 0YUr5u5RS045t1ZDbzElwxmDzSch0cSzXJfO+DqjjD2NMmzen/KbzmamvA23XonR Z0nnst7jQbsEHzrWrhz8FOhghe1GYHaTlrjYnPDhgSVBN6/PeXc= =m++n -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmDx83wACgkQmmx57+YA GNnv0Q/+LgdKP7Ad9iY9ROEpv2LtbzCjo4754/c9DA/6sBRI5oMYr7arH9rE14Xt YJsK6/vjIBnnafpg4uZTuv/Wm+12r9aRJCC8istwGpdmwzTRZiq8w0CAg54/PQaA 9WMV+qhfIOCpxH9Anl0Me2NZzq62bUs1o3c04jaAWH5bPIPUFZoDxXqOSmsRjUni TpCvQ3Iu7l8cULqbV+ydN0VIE7zNLgnPwlVaeGzRP6VLI6vsZrkQRj7M3Od2iaQw ubrqPFcrUzKPnjntBDDuOqaO66wrEVH0cYZDyrytYgtZ9KwxzWdgBp6jnePAO2sd e90u3i5iIqFl7Mm64OtyUAgQAe6eXf8y332UIjMTtmwUhfuG8bfYWW7W3Y2P2y1n 6RSmT74dyc4ns9N6u0+W8pC6QVfawsOt/UwQ8UMoj6rGaH1LpL3xQu287kK0mVI2 /ZrMr/v4YgWEK90J8Zjkn6TBik2ghgSwQsfcPjuN+GjFZLXD5I+bbJEI4+flC2BR +VRyBrwNk/yS/Of5KWqOszD+qYnR3q5RpWUFX/wZyjIGyzaboVLUfi0RyuwjDt4c xK/KiHgM+OIrTCDBC8dC7DcQgeAIbj6YUKAIEbe1dA+AjyAZFtL0kC9XgnXSCZus AFkwKY3bYSxq+DMEdBUJ6Zfr12s+pYC3h/xkJEZNn6PcAbD3swg= =VcLV -----END PGP SIGNATURE----- Merge tag 'arm-ffa-fixes-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm FF-A fixes for v5.14 A small set of fixes: - adding check for presence of probe while registering the driver to prevent NULL pointer access - dropping the duplicate check as the driver core already takes care of it - fixing possible ffa_linux_errmap buffer overflow and - fixing kernel-doc warning for comment style * tag 'arm-ffa-fixes-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Fix a possible ffa_linux_errmap buffer overflow firmware: arm_ffa: Fix the comment style firmware: arm_ffa: Simplify probe function firmware: arm_ffa: Ensure drivers provide a probe function Link: https://lore.kernel.org/r/20210714165806.2617325-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
d28912d6f0
@ -46,9 +46,6 @@ static int ffa_device_probe(struct device *dev)
|
||||
struct ffa_driver *ffa_drv = to_ffa_driver(dev->driver);
|
||||
struct ffa_device *ffa_dev = to_ffa_dev(dev);
|
||||
|
||||
if (!ffa_device_match(dev, dev->driver))
|
||||
return -ENODEV;
|
||||
|
||||
return ffa_drv->probe(ffa_dev);
|
||||
}
|
||||
|
||||
@ -99,6 +96,9 @@ int ffa_driver_register(struct ffa_driver *driver, struct module *owner,
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!driver->probe)
|
||||
return -EINVAL;
|
||||
|
||||
driver->driver.bus = &ffa_bus_type;
|
||||
driver->driver.name = driver->name;
|
||||
driver->driver.owner = owner;
|
||||
|
@ -120,7 +120,7 @@
|
||||
#define PACK_TARGET_INFO(s, r) \
|
||||
(FIELD_PREP(SENDER_ID_MASK, (s)) | FIELD_PREP(RECEIVER_ID_MASK, (r)))
|
||||
|
||||
/**
|
||||
/*
|
||||
* FF-A specification mentions explicitly about '4K pages'. This should
|
||||
* not be confused with the kernel PAGE_SIZE, which is the translation
|
||||
* granule kernel is configured and may be one among 4K, 16K and 64K.
|
||||
@ -149,8 +149,10 @@ static const int ffa_linux_errmap[] = {
|
||||
|
||||
static inline int ffa_to_linux_errno(int errno)
|
||||
{
|
||||
if (errno < FFA_RET_SUCCESS && errno >= -ARRAY_SIZE(ffa_linux_errmap))
|
||||
return ffa_linux_errmap[-errno];
|
||||
int err_idx = -errno;
|
||||
|
||||
if (err_idx >= 0 && err_idx < ARRAY_SIZE(ffa_linux_errmap))
|
||||
return ffa_linux_errmap[err_idx];
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user