mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: "Jürgen Groß" <jgross@suse.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] xen/gntdev: remove redundant non-zero check on ret
Date: Mon, 11 Nov 2019 12:31:30 +0000	[thread overview]
Message-ID: <ec4ffabf-9cfa-2db6-7e23-60f84947d0a9@canonical.com> (raw)
In-Reply-To: <04efe197-2914-ab1d-918b-8899aa0354af@suse.com>

On 11/11/2019 12:25, Jürgen Groß wrote:
> On 11.11.19 13:20, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The non-zero check on ret is always going to be false because
>> ret was initialized as zero and the only place it is set to
>> non-zero contains a return path before the non-zero check. Hence
>> the check is redundant and can be removed.
> 
> Which version did you patch against? In current master the above
> statement is not true.

against today's linux-next

Colin
> 
> 
> Juergen
> 
>>
>> Addresses-Coverity: ("Logically dead code")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/xen/gntdev.c | 5 -----
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
>> index 10cc5e9e612a..07d80b176118 100644
>> --- a/drivers/xen/gntdev.c
>> +++ b/drivers/xen/gntdev.c
>> @@ -524,11 +524,6 @@ static int gntdev_open(struct inode *inode,
>> struct file *flip)
>>       }
>>   #endif
>>   -    if (ret) {
>> -        kfree(priv);
>> -        return ret;
>> -    }
>> -
>>       flip->private_data = priv;
>>   #ifdef CONFIG_XEN_GRANT_DMA_ALLOC
>>       priv->dma_dev = gntdev_miscdev.this_device;
>>
> 


  reply	other threads:[~2019-11-11 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 12:20 Colin King
2019-11-11 12:25 ` Jürgen Groß
2019-11-11 12:31   ` Colin Ian King [this message]
2019-11-11 13:17     ` Jürgen Groß
2019-11-11 13:23       ` Colin Ian King

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=ec4ffabf-9cfa-2db6-7e23-60f84947d0a9@canonical.com \
    --to=colin.king@canonical.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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

all inboxes | Powered by JetHome®