Re: FAILED: patch "[PATCH] w1 - fix fops in w1_bus_notify" failed to apply to 3.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/31/2013 02:48 AM, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
The patch below does not apply to the 3.11-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@xxxxxxxxxxxxxxx>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

 From 2962aecef2878e2192ac9676700469678507c24d Mon Sep 17 00:00:00 2001
From: Hans-Frieder Vogt <hfvogt@xxxxxxx>
Date: Sun, 6 Oct 2013 21:13:35 +0200
Subject: [PATCH] w1 - fix fops in w1_bus_notify

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@xxxxxxx>
Acked-by: Evgeniy Polyakov <zbr@xxxxxxxxxxx>
Cc: stable <stable@xxxxxxxxxxxxxxx> # 3.11+

Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index c7c64f18..0781217d 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -613,6 +613,9 @@ static int w1_bus_notify(struct notifier_block *nb, unsigned long action,

The patch should not be back-ported to 3.11, as w1_bus_notify() was introduced since v3.12-rc1 in commit 47eba33

Thanks,
Zhouping

  	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... */

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]