Introduce a check to make sure that fops are only called if they have
been defined by the slave module.
Without this check modules like w1_smem cause a NULL pointer dereference
bug.
Signed-off by: Hans-Frieder Vogt <
[email protected]>
Acked-by: Evgeniy Polyakov <[email protected]>
Cc: stable <[email protected]> # 3.11+
Signed-off-by: Greg Kroah-Hartman <[email protected]>
sl = dev_to_w1_slave(dev);
fops = sl->family->fops;
+ if (!fops)
+ return 0;
+
switch (action) {
case BUS_NOTIFY_ADD_DEVICE:
/* if the family driver needs to initialize something... */