diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-06-21 23:16:51 +0300 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2021-07-12 16:20:06 +0300 |
commit | 92743071464fca5acbbe812d9a0d88de3eaaad36 (patch) | |
tree | eb4df7ffc543e5c5b7c330aa9b6292f1e407c2ef /drivers/firmware | |
parent | e73f0f0ee7541171d89f2e2491130c7771ba58d3 (diff) | |
download | linux-92743071464fca5acbbe812d9a0d88de3eaaad36.tar.xz |
firmware: arm_ffa: Ensure drivers provide a probe function
The bus probe callback calls the driver callback without further
checking. Better be safe than sorry and refuse registration of a driver
without a probe function to prevent a NULL pointer exception.
Link: https://lore.kernel.org/r/20210621201652.127611-1-u.kleine-koenig@pengutronix.de
Fixes: e781858488b9 ("firmware: arm_ffa: Add initial FFA bus support for device enumeration")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/arm_ffa/bus.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index 83166e02b191..d2cc24319626 100644 --- a/drivers/firmware/arm_ffa/bus.c +++ b/drivers/firmware/arm_ffa/bus.c @@ -99,6 +99,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; |