firmware: arm_scmi: 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/20210624095059.4010157-2-sudeep.holla@arm.com
Fixes: 933c504424
("firmware: arm_scmi: add scmi protocol bus to enumerate protocol devices")
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
parent
38e0c99249
commit
5e469dac32
|
@ -134,6 +134,9 @@ int scmi_driver_register(struct scmi_driver *driver, struct module *owner,
|
|||
{
|
||||
int retval;
|
||||
|
||||
if (!driver->probe)
|
||||
return -EINVAL;
|
||||
|
||||
retval = scmi_protocol_device_request(driver->id_table);
|
||||
if (retval)
|
||||
return retval;
|
||||
|
|
Loading…
Reference in New Issue