From: Colin Ian King <colin.king@canonical.com>
To: John Stultz <john.stultz@linaro.org>, "Andrew F. Davis" <afd@ti.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>,
Liam Mark <lmark@codeaurora.org>,
Laura Abbott <labbott@redhat.com>,
Brian Starkey <brian.starkey@arm.com>,
linux-media@vger.kernel.org,
dri-devel <dri-devel@lists.freedesktop.org>,
"moderated list:DMA BUFFER SHARING FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>,
kernel-janitors@vger.kernel.org,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] dma-buf: heaps: remove redundant assignment to variable ret
Date: Thu, 31 Oct 2019 09:34:37 +0100 [thread overview]
Message-ID: <93d7256e-daa9-ad1d-3684-7416f65a38dd@canonical.com> (raw)
In-Reply-To: <CALAqxLVvkd73zQria9C+QcyF1P2cZ7=pOpVQO+AyWzqJQ_q3Yw@mail.gmail.com>
On 30/10/2019 17:21, John Stultz wrote:
> On Wed, Oct 30, 2019 at 8:45 AM Andrew F. Davis <afd@ti.com> wrote:
>>
>> On 10/30/19 11:02 AM, Colin King wrote:
>>> From: Colin Ian King <colin.king@canonical.com>
>>>
>>> The variable ret is being assigned with a value that is never
>>> read, it is being re-assigned the same value on the err0 exit
>>> path. The assignment is redundant and hence can be removed.
>>>
>>> Addresses-Coverity: ("Unused value")
>>> Fixes: 47a32f9c1226 ("dma-buf: heaps: Add system heap to dmabuf heaps")
>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>> ---
>>
>>
>> The root of the issue is that ret is not used in the error path, it
>> should be, I suggest this fix:
>>
>>> --- a/drivers/dma-buf/heaps/system_heap.c
>>> +++ b/drivers/dma-buf/heaps/system_heap.c
>>> @@ -98,7 +98,7 @@ static int system_heap_allocate(struct dma_heap *heap,
>>> err0:
>>> kfree(helper_buffer);
>>>
>>> - return -ENOMEM;
>>> + return ret;
>>> }
>
> Sounds good! If its ok I'll generate a commit crediting Colin for
> reporting the issue and Andrew for the fix and submit it to Sumit.
Thanks for the correct fix.
Colin
>
> Many thanks to you both!
> -john
>
prev parent reply other threads:[~2019-10-31 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 15:02 [PATCH][next] dma-buf: heaps: remove redundant assignment to variable ret Colin King
2019-10-30 15:45 ` Andrew F. Davis
2019-10-30 16:21 ` John Stultz
2019-10-31 8:34 ` Colin Ian King [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=93d7256e-daa9-ad1d-3684-7416f65a38dd@canonical.com \
--to=colin.king@canonical.com \
--cc=afd@ti.com \
--cc=benjamin.gaignard@linaro.org \
--cc=brian.starkey@arm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=john.stultz@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=labbott@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lmark@codeaurora.org \
--cc=sumit.semwal@linaro.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;
as well as URLs for NNTP newsgroup(s).