From: Uwe Kleine-König Date: Mon, 21 Jun 2021 20:16:51 +0000 (+0200) Subject: firmware: arm_ffa: Ensure drivers provide a probe function X-Git-Tag: accepted/tizen/unified/20230118.172025~6792^2~9^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92743071464fca5acbbe812d9a0d88de3eaaad36;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Sudeep Holla --- diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index 83166e0..d2cc243 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;