From: Dan Carpenter <dan.carpenter@oracle.com>
To: Michael Straube <straube.linux@gmail.com>
Cc: gregkh@linuxfoundation.org, linux@wolf-entwicklungen.de,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: pi433: add missing call to cdev_del()
Date: Mon, 26 Nov 2018 21:01:05 +0300 [thread overview]
Message-ID: <20181126180105.GM2970@unbuntlaptop> (raw)
In-Reply-To: <20181126175355.18800-1-straube.linux@gmail.com>
On Mon, Nov 26, 2018 at 06:53:55PM +0100, Michael Straube wrote:
> If cdev_add() fails, cdev_del() should be called.
> Add the missing cdev_del() call as pointed out by
> Dan Carpenter.
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
> drivers/staging/pi433/pi433_if.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
> index d72de2105053..abc98a544929 100644
> --- a/drivers/staging/pi433/pi433_if.c
> +++ b/drivers/staging/pi433/pi433_if.c
> @@ -1254,6 +1254,7 @@ static int pi433_probe(struct spi_device *spi)
> retval = cdev_add(device->cdev, device->devt, 1);
> if (retval) {
> dev_dbg(device->dev, "register of cdev failed");
> + cdev_del(device->cdev);
> goto cdev_failed;
No no... That's not the right thing. Do "goto del_cdev;" and add a
label at the end.
del_cdev:
cdev_del(device->cdev);
regards,
dan carpenter
next prev parent reply other threads:[~2018-11-26 21:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 17:53 Michael Straube
2018-11-26 18:01 ` Dan Carpenter [this message]
2018-11-26 18:12 ` Michael Straube
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=20181126180105.GM2970@unbuntlaptop \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@wolf-entwicklungen.de \
--cc=straube.linux@gmail.com \
/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
all inboxes | Powered by JetHome®