All kmalloc-based functions print enough information on failures.

Signed-off-by: Wolfram Sang <[email protected]>
---
 drivers/usb/dwc2/gadget.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index af46adfae41ca5..2ff03ae08e144d 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3908,17 +3908,13 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
 
        hsotg->ctrl_buff = devm_kzalloc(hsotg->dev,
                        DWC2_CTRL_BUFF_SIZE, GFP_KERNEL);
-       if (!hsotg->ctrl_buff) {
-               dev_err(dev, "failed to allocate ctrl request buff\n");
+       if (!hsotg->ctrl_buff)
                return -ENOMEM;
-       }
 
        hsotg->ep0_buff = devm_kzalloc(hsotg->dev,
                        DWC2_CTRL_BUFF_SIZE, GFP_KERNEL);
-       if (!hsotg->ep0_buff) {
-               dev_err(dev, "failed to allocate ctrl reply buff\n");
+       if (!hsotg->ep0_buff)
                return -ENOMEM;
-       }
 
        ret = devm_request_irq(hsotg->dev, irq, dwc2_hsotg_irq, IRQF_SHARED,
                                dev_name(hsotg->dev), hsotg);
-- 
2.9.3

--
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

Reply via email to