From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] misc/apds9802als: Delete an error message for a failed memory allocation in apds9802als_probe()
Date: Sun, 7 Jan 2018 22:02:26 +0100 [thread overview]
Message-ID: <501c9715-0f40-7365-07e9-23201f8f540b@users.sourceforge.net> (raw)
In-Reply-To: <cfd7cb73-7437-0d95-ef7a-8c8f6ce49e3d@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 7 Jan 2018 21:42:07 +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/misc/apds9802als.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c
index d8ac036f01ab..fa548796c92e 100644
--- a/drivers/misc/apds9802als.c
+++ b/drivers/misc/apds9802als.c
@@ -231,10 +231,9 @@ static int apds9802als_probe(struct i2c_client *client,
struct als_data *data;
data = kzalloc(sizeof(struct als_data), GFP_KERNEL);
- if (data == NULL) {
- dev_err(&client->dev, "Memory allocation failed\n");
+ if (!data)
return -ENOMEM;
- }
+
i2c_set_clientdata(client, data);
res = sysfs_create_group(&client->dev.kobj, &m_als_gr);
if (res) {
--
2.15.1
next prev parent reply other threads:[~2018-01-07 21:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-07 21:01 [PATCH 0/2] misc/apds9802als: Adjustments for apds9802als_probe() SF Markus Elfring
2018-01-07 21:02 ` SF Markus Elfring [this message]
2018-01-07 21:03 ` [PATCH 2/2] misc/apds9802als: Improve a size determination in apds9802als_probe() 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=501c9715-0f40-7365-07e9-23201f8f540b@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome