From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-input@vger.kernel.org,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Jiri Kosina <jikos@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] hid-lg4ff: Delete an error message for a failed memory allocation in lg4ff_init()
Date: Tue, 6 Feb 2018 15:47:33 +0100 [thread overview]
Message-ID: <fadaaa7a-a632-ecb8-de75-05a85132a171@users.sourceforge.net> (raw)
In-Reply-To: <5c76a767-b1cb-2486-f24d-0d5a220b8985@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Feb 2018 15:26:06 +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/hid/hid-lg4ff.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 512d67e1aae3..ec6b94bb3fd8 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -1401,10 +1401,8 @@ int lg4ff_init(struct hid_device *hid)
for (j = 0; j < 5; j++) {
led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL);
- if (!led) {
- hid_err(hid, "can't allocate memory for LED %d\n", j);
+ if (!led)
goto err_leds;
- }
name = (void *)(&led[1]);
snprintf(name, name_sz, "%s::RPM%d", dev_name(&hid->dev), j+1);
--
2.16.1
prev parent reply other threads:[~2018-02-06 14:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 14:43 [PATCH 0/3] HID-Logitech: Adjustments for two function implementations SF Markus Elfring
2018-02-06 14:45 ` [PATCH 1/3] hid-lg: Delete an error message for a failed memory allocation in lg_probe() SF Markus Elfring
2018-02-06 14:46 ` [PATCH 2/3] hid-lg: Improve a size determination " SF Markus Elfring
2018-02-06 14:47 ` SF Markus Elfring [this message]
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=fadaaa7a-a632-ecb8-de75-05a85132a171@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@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;
as well as URLs for NNTP newsgroup(s).