From: Markus Elfring <Markus.Elfring@web.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-input@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org,
"Oliver Graute" <oliver.graute@kococonnector.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"ye xingchen" <ye.xingchen@zte.com.cn>,
LKML <linux-kernel@vger.kernel.org>,
cocci@inria.fr
Subject: Re: [cocci] Input: usbtouchscreen - Return directly after a failed kmalloc() in nexio_init()
Date: Fri, 29 Dec 2023 09:56:22 +0100 [thread overview]
Message-ID: <d224c77f-048a-4fb4-b582-492fd428e270@web.de> (raw)
In-Reply-To: <ZY54UDosMHwj6D3Y@google.com>
>> The kfree() function was called in one case by
>> the nexio_init() function during error handling
>> even if the passed variable contained a null pointer.
>
> Which is perfectly valid thing to do, like free(), kfree() accepts NULL argument.
I find such a function call with this special parameter not so useful.
>> Thus return directly after a call of the function “kmalloc” failed
>> at the beginning.
>
> This is simply a matter of preference, the original author preferred
> that style, I see no objective reason to change it.
Would you ever like to avoid redundant data processing a bit more?
Regards,
Markus
prev parent reply other threads:[~2023-12-29 8:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-26 20:08 [cocci] [PATCH] Input: usbtouchscreen - Return directly after a failed kmalloc() in nexio_init() Markus Elfring
[not found] ` <ZY54UDosMHwj6D3Y@google.com>
2023-12-29 8:56 ` 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=d224c77f-048a-4fb4-b582-492fd428e270@web.de \
--to=markus.elfring@web.de \
--cc=cocci@inria.fr \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.graute@kococonnector.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=ye.xingchen@zte.com.cn \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).