[PATCH 1/4] [media] zr364xx: Delete an error message for a failed memory allocation in two functions

From: SF Markus Elfring
Date: Tue Aug 29 2017 - 01:32:12 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Aug 2017 22:23:56 +0200

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/media/usb/zr364xx/zr364xx.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c
index efdcd5bd6a4c..97af697dcc81 100644
--- a/drivers/media/usb/zr364xx/zr364xx.c
+++ b/drivers/media/usb/zr364xx/zr364xx.c
@@ -212,7 +212,5 @@ static int send_control_msg(struct usb_device *udev, u8 request, u16 value,
- if (!transfer_buffer) {
- dev_err(&udev->dev, "kmalloc(%d) failed\n", size);
+ if (!transfer_buffer)
return -ENOMEM;
- }

memcpy(transfer_buffer, cp, size);

@@ -1427,7 +1425,5 @@ static int zr364xx_probe(struct usb_interface *intf,
- if (cam == NULL) {
- dev_err(&udev->dev, "cam: out of memory !\n");
+ if (!cam)
return -ENOMEM;
- }

cam->v4l2_dev.release = zr364xx_release;
err = v4l2_device_register(&intf->dev, &cam->v4l2_dev);
--
2.14.1