lkml.org 
[lkml]   [2017]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/5] [media] s2255drv: Delete three error messages for a failed memory allocation in s2255_probe()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 20 Sep 2017 16:30:13 +0200

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/usb/s2255/s2255drv.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index b2f239c4ba42..29285e8cd742 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -2242,13 +2242,9 @@ static int s2255_probe(struct usb_interface *interface,
- if (dev == NULL) {
- s2255_dev_err(&interface->dev, "out of memory\n");
+ if (!dev)
return -ENOMEM;
- }

dev->cmdbuf = kzalloc(S2255_CMDBUF_SIZE, GFP_KERNEL);
- if (dev->cmdbuf == NULL) {
- s2255_dev_err(&interface->dev, "out of memory\n");
+ if (!dev->cmdbuf)
goto errorFWDATA1;
- }

atomic_set(&dev->num_channels, 0);
dev->pid = id->idProduct;
@@ -2303,7 +2299,6 @@ static int s2255_probe(struct usb_interface *interface,
- if (!dev->fw_data->pfw_data) {
- dev_err(&interface->dev, "out of memory!\n");
+ if (!dev->fw_data->pfw_data)
goto errorFWDATA2;
- }
+
/* load the first chunk */
if (request_firmware(&dev->fw_data->fw,
FIRMWARE_FILE_NAME, &dev->udev->dev)) {
--
2.14.1
\
 
 \ /
  Last update: 2017-09-20 18:59    [W:0.058 / U:1.460 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site