mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Airlie <airlied@linux.ie>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] drm: omapdrm: silence unititialized variable warning
Date: Wed, 2 May 2018 11:59:33 +0300	[thread overview]
Message-ID: <5184a8fa-4acb-e6b5-099d-aca1793b1b71@ti.com> (raw)
In-Reply-To: <20180418142937.GA13828@mwanda>

Hi,

On 18/04/18 17:29, Dan Carpenter wrote:
> Smatch complains that "area_free" could be used without being
> initialized.  This code is several years old and premusably works fine
> so this can't be a very serious bug.  But it's easy enough to silence
> the warning.  If "area_free" is false at the end of the function then
> we return -ENOMEM.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/omapdrm/tcm-sita.c b/drivers/gpu/drm/omapdrm/tcm-sita.c
> index d7f7bc9f061a..817be3c41863 100644
> --- a/drivers/gpu/drm/omapdrm/tcm-sita.c
> +++ b/drivers/gpu/drm/omapdrm/tcm-sita.c
> @@ -90,7 +90,7 @@ static int l2r_t2b(u16 w, u16 h, u16 a, s16 offset,
>  {
>  	int i;
>  	unsigned long index;
> -	bool area_free;
> +	bool area_free = false;
>  	unsigned long slots_per_band = PAGE_SIZE / slot_bytes;
>  	unsigned long bit_offset = (offset > 0) ? offset / slot_bytes : 0;
>  	unsigned long curr_bit = bit_offset;
> 

Thanks, I've queued this for 4.17 fixes.

 Tomi

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

      reply	other threads:[~2018-05-02  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 14:29 Dan Carpenter
2018-05-02  8:59 ` Tomi Valkeinen [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=5184a8fa-4acb-e6b5-099d-aca1793b1b71@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=airlied@linux.ie \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®