Skip to contentSkip to conversation

usb: gadget: f_rndis: fix an error code on allocation failure

PATCH In review Dan Carpenter 2 participants 2 messages May 21, 2014 – May 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: f_rndis: fix an error code on allocation failure

This should be return -ENOMEM. The current code returns successs.

Fixes de7a8d2d534f ('usb: gadget: f_rndis: OS descriptors support')
drivers/usb/gadget/f_rndis.c +1 -1
index eed3ad8..31274f7 100644
@@ -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;
 	}
Acked-by on v1 1/1
#1 lore raw

W dniu 21.05.2014 14:26, Dan Carpenter pisze:

Quoted 5 lines

This should be return -ENOMEM. The current code returns successs.

Fixes de7a8d2d534f ('usb: gadget: f_rndis: OS descriptors support')
Quoted 18 lines
drivers/usb/gadget/f_rndis.c +1 -2
index eed3ad8..31274f7 100644
@@ -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;
  	}
--

To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html