From: Markus Elfring <elfr...@users.sourceforge.net>
Date: Tue, 5 Dec 2017 20:30:50 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>
---
 drivers/uwb/hwa-rc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 9a53912bdfe9..ecd1f0d60487 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -835,10 +835,9 @@ static int hwarc_probe(struct usb_interface *iface,
                goto error_rc_alloc;
        }
        hwarc = kzalloc(sizeof(*hwarc), GFP_KERNEL);
-       if (hwarc == NULL) {
-               dev_err(dev, "unable to allocate HWA RC instance\n");
+       if (!hwarc)
                goto error_alloc;
-       }
+
        hwarc_init(hwarc);
        hwarc->usb_dev = usb_get_dev(interface_to_usbdev(iface));
        hwarc->usb_iface = usb_get_intf(iface);
-- 
2.15.1

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

Reply via email to