From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Arvind Yadav <arvind.yadav.cs@gmail.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Jonathan Sims <jonathan.625266@earthlink.net>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/3] [media] hdpvr: Delete three error messages for a failed memory allocation
Date: Tue, 19 Sep 2017 20:45:40 +0200 [thread overview]
Message-ID: <3dc5f6be-6002-5cbf-a820-d803f9afad69@users.sourceforge.net> (raw)
In-Reply-To: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
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
next prev parent reply other threads:[~2017-09-19 18:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 18:44 [PATCH 0/3] [media] HD PVR USB: Adjustments for two function implementations SF Markus Elfring
2017-09-19 18:45 ` SF Markus Elfring [this message]
2017-09-19 18:46 ` [PATCH 2/3] [media] hdpvr: Improve a size determination in hdpvr_alloc_buffers() SF Markus Elfring
2017-09-19 18:47 ` [PATCH 3/3] [media] hdpvr: Return an error code only as a constant " SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3dc5f6be-6002-5cbf-a820-d803f9afad69@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=jonathan.625266@earthlink.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).