From: valdis.kletnieks@vt.edu
To: Bharath Vedartham <linux.bhar@gmail.com>
Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: iio: industrialio-core: add check when kzalloc fails
Date: Sun, 27 Jan 2019 18:08:36 -0500 [thread overview]
Message-ID: <17314.1548630516@turing-police.cc.vt.edu> (raw)
In-Reply-To: <20190124142755.GA31059@bhar.linux>
On Thu, 24 Jan 2019 19:58:00 +0530, Bharath Vedartham said:
> add code to handle the case when kzalloc fails to allocate memory to dev
>
> Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
> dev_set_name(&dev->dev, "iio:device%d", dev->id);
> INIT_LIST_HEAD(&dev->buffer_list);
> + } else {
> + return NULL;
> }
>
> return dev;
Not needed, as the 'if (dev)' statement fails, dev is already null.
prev parent reply other threads:[~2019-01-27 23:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-24 14:28 [PATCH] drivers: iio: industrialio-core: add check when kzalloc fails Bharath Vedartham
2019-01-25 6:55 ` Alexandru Ardelean
2019-01-25 10:53 ` Himanshu Jha
2019-01-25 11:40 ` Bharath Vedartham
2019-01-27 23:08 ` valdis.kletnieks [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=17314.1548630516@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux.bhar@gmail.com \
--cc=pmeerw@pmeerw.net \
/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