mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
thunderbolt: Assert that a service driver has a probe callback
tb_service_probe() calls the driver's probe function unconditionally. Check at driver register time that this callback is valid to prevent a NULL pointer exception. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
parent
45f104755a
commit
36eea3468c
|
|
@ -968,6 +968,9 @@ tb_xdp_schedule_request(struct tb *tb, const struct tb_xdp_header *hdr,
|
|||
*/
|
||||
int tb_register_service_driver(struct tb_service_driver *drv)
|
||||
{
|
||||
if (!drv->probe)
|
||||
return -EINVAL;
|
||||
|
||||
drv->driver.bus = &tb_bus_type;
|
||||
return driver_register(&drv->driver);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user