Messages in this thread Patch in this message | | | From | Hans-Frieder Vogt <> | Subject | [PATCH 1/2] w1 - fix fops in w1_bus_notify | Date | Sun, 06 Oct 2013 21:13:35 +0200 |
| |
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 <hfvogt@gmx.net> --- drivers/w1/w1.c | 3 +++ 1 file changed, 3 insertions(+)
--- a/drivers/w1/w1.c 2013-09-24 21:24:20.803261482 +0200 +++ b/drivers/w1/w1.c 2013-10-06 14:58:45.246528318 +0200 @@ -613,6 +613,9 @@ static int w1_bus_notify(struct notifier 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... */ Hans-Frieder Vogt e-mail: hfvogt <at> gmx .dot. net
| |