[PATCH 1/3] [media] hdpvr: Delete three error messages for a failed memory allocation

From: SF Markus Elfring
Date: Tue Sep 19 2017 - 14:46:03 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Sep 2017 09:33:26 +0200

Omit extra messages 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/hdpvr/hdpvr-core.c | 8 ++------
drivers/media/usb/hdpvr/hdpvr-video.c | 5 ++---
2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index dbe29c6c4d8b..f1c156814e10 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -282,6 +282,4 @@ static int hdpvr_probe(struct usb_interface *interface,
- if (!dev) {
- dev_err(&interface->dev, "Out of memory\n");
+ if (!dev)
goto error;
- }

/* init video transfer queues first of all */
@@ -302,6 +300,4 @@ static int hdpvr_probe(struct usb_interface *interface,
- if (!dev->usbc_buf) {
- v4l2_err(&dev->v4l2_dev, "Out of memory\n");
+ if (!dev->usbc_buf)
goto error;
- }

init_waitqueue_head(&dev->wait_buffer);
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 7fb036d6a86e..657d910dfa1d 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -150,7 +150,6 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
- if (!buf) {
- v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n");
+ if (!buf)
goto exit;
- }
+
buf->dev = dev;

urb = usb_alloc_urb(0, GFP_KERNEL);
--
2.14.1