usb: gadget: f_rndis: fix an error code on allocation failure
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 May 2014 12:26:55 +0000 (15:26 +0300)
committerFelipe Balbi <balbi@ti.com>
Thu, 19 Jun 2014 13:52:14 +0000 (08:52 -0500)
This should be return -ENOMEM.  The current code returns successs.

Fixes: de7a8d2d534f ('usb: gadget: f_rndis: OS descriptors support')
Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_rndis.c

index eed3ad8780478e23bcaf07402d1f658914d1d484..31274f70c4b9914702f6e83fd12493f8227f343c 100644 (file)
@@ -687,7 +687,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
                f->os_desc_table = kzalloc(sizeof(*f->os_desc_table),
                                           GFP_KERNEL);
                if (!f->os_desc_table)
-                       return PTR_ERR(f->os_desc_table);
+                       return -ENOMEM;
                f->os_desc_n = 1;
                f->os_desc_table[0].os_desc = &rndis_opts->rndis_os_desc;
        }