From: Matthias Hintzmann matthias.dev@gmx.de
ctx->drvflags is checked in the if clause before beeing initialized. Move initialization before first usage.
Note, that the if clause was backported from mainline at Nov. 15th 2017 (GetNtbFormat endian fix). In mainline, the initialization is at the right place before the if clause.
Signed-off-by: Matthias Hintzmann matthias.dev@gmx.de --- drivers/net/usb/cdc_ncm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 1228d0da407..72cb30828a1 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -825,6 +825,9 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ goto error2; }
+ /* Device-specific flags */ + ctx->drvflags = drvflags; + /* * Some Huawei devices have been observed to come out of reset in NDP32 mode. * Let's check if this is the case, and set the device to NDP16 mode again if @@ -873,9 +876,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ /* finish setting up the device specific data */ cdc_ncm_setup(dev);
- /* Device-specific flags */ - ctx->drvflags = drvflags; - /* Allocate the delayed NDP if needed. */ if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) { ctx->delayed_ndp16 = kzalloc(ctx->max_ndp_size, GFP_KERNEL);
On Sat, Feb 03, 2018 at 11:30:32AM +0100, Matthias wrote:
From: Matthias Hintzmann matthias.dev@gmx.de
ctx->drvflags is checked in the if clause before beeing initialized. Move initialization before first usage.
Note, that the if clause was backported from mainline at Nov. 15th 2017 (GetNtbFormat endian fix). In mainline, the initialization is at the right place before the if clause.
Please format the lines at 72 columns :(
Also, what git commit id is this fixing?
And finally, what stable tree(s) do you want it applied to?
thanks,
greg k-h
On Mon, 5 Feb 2018 09:56:23 -0800 Greg KH gregkh@linuxfoundation.org wrote:
Please format the lines at 72 columns :(
Also, what git commit id is this fixing?
And finally, what stable tree(s) do you want it applied to?
Sorry for the inconvenience! We created and submitted a v2 of the patch where we added the missing commit ids and the stable kernel tree it should be applied to (4.4; as far as I can see, the problem is only present there).
Thank you very much. Kind regards, Matthias
linux-stable-mirror@lists.linaro.org