lkml.org 
[lkml]   [2018]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] i2c-tiny-usb: Delete an error message for a failed memory allocation in i2c_tiny_usb_probe()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 1 Feb 2018 17:36: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@users.sourceforge.net>
---
drivers/i2c/busses/i2c-tiny-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index a2e3dd715380..e210e36df123 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -230,10 +230,8 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,

/* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
- if (dev == NULL) {
- dev_err(&interface->dev, "Out of memory\n");
+ if (!dev)
goto error;
- }

dev->usb_dev = usb_get_dev(interface_to_usbdev(interface));
dev->interface = interface;
--
2.16.1
\
 
 \ /
  Last update: 2018-02-01 17:57    [W:0.705 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site