[PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe()

From: SF Markus Elfring
Date: Tue Dec 05 2017 - 15:27:23 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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 <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
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