public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Joe Jin <joe.jin@oracle.com>,
	open list <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] xen-blkback: add missing return on error in xen_update_blkif_status()
Date: Fri, 05 Aug 2011 17:05:54 +0200	[thread overview]
Message-ID: <4E3C06D2.2020309@redhat.com> (raw)
In-Reply-To: <20110805141821.GK7659@shale.localdomain>

On 08/05/11 16:18, Dan Carpenter wrote:
> We should return here after reporting the error.  Otherwise we'd hit
> a NULL deref of blkif->xenblkd on the next line.
>
> Signed-off-by: Dan Carpenter<error27@gmail.com>
>
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index 32d4c3c..b750299 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -107,6 +107,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
>   		err = PTR_ERR(blkif->xenblkd);
>   		blkif->xenblkd = NULL;
>   		xenbus_dev_error(blkif->be->dev, err, "start xenblkd");
> +		return;
>   	}
>
>   	blkif->be->kthread_pid = blkif->xenblkd->pid;

In case somebody were asking for my opinion:

I think this block was the last block in the originally containing 
function (update_blkif_status()?), thus the "return" wasn't needed 
there. I guess the block got copied and then other code was added below it.

Acked-by: Laszlo Ersek <lersek@redhat.com>

  reply	other threads:[~2011-08-05 15:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 14:18 [patch] xen-blkback: add missing return on error in xen_update_blkif_status() Dan Carpenter
2011-08-05 15:05 ` Laszlo Ersek [this message]
2011-08-06 14:46 ` Konrad Rzeszutek Wilk

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=4E3C06D2.2020309@redhat.com \
    --to=lersek@redhat.com \
    --cc=error27@gmail.com \
    --cc=joe.jin@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=konrad.wilk@oracle.com \
    --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