From: Bjørn Mork Date: Fri, 1 Nov 2013 10:16:59 +0000 (+0100) Subject: net: cdc_ncm: return proper error if setup fails X-Git-Tag: firefly_0821_release~176^2~4992^2~79^2~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=59ede3168a0b3fe02f82a7bed52432f18dbb1070;p=firefly-linux-kernel-4.4.55.git net: cdc_ncm: return proper error if setup fails Most setup errors are ignored to ensure maximum firmware compatibilty. But GET_NTB_PARAMETERS and the functional descriptors are required. Use proper error codes and log level if these fail. Cc: Alexey Orishko Signed-off-by: Bjørn Mork Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 62dcb2e11e0b..f168bc8c1d38 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -86,8 +86,8 @@ static u8 cdc_ncm_setup(struct usbnet *dev) 0, iface_no, &ncm_parm, sizeof(ncm_parm)); if (err < 0) { - dev_dbg(&dev->intf->dev, "failed GET_NTB_PARAMETERS\n"); - return 1; + dev_err(&dev->intf->dev, "failed GET_NTB_PARAMETERS\n"); + return err; /* GET_NTB_PARAMETERS is required */ } /* read correct set of parameters according to device mode */