public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: Darren Jenkins <darrenrjenkins@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
	dri-devel mailing list <dri-devel@lists.sourceforge.net>,
	Kernel Janitors <kernel-janitors@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/radeon/r100.c: check for invalid family
Date: Thu, 07 Jan 2010 03:47:07 +0000	[thread overview]
Message-ID: <21d7e9971001061947k16ef1367k3c331a8849ce0109@mail.gmail.com> (raw)
In-Reply-To: <1262136291.8733.35.camel@ICE-BOX>

On Wed, Dec 30, 2009 at 11:24 AM, Darren Jenkins
<darrenrjenkins@gmail.com> wrote:
> If there is an invalid family the fw_name is NULL and causes an
> NULL pointer dereference.
> This just adds a check for something unexpected.

NAK.

This can't happen, only gpus with those families set can call this function,
so we can't get in here without the correct family, and if we did it would be
due to developer error, so oopsing is very appropriate.

Dave.

>
> Coverity CID: 13251
>
> Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
>
> diff --git drivers/gpu/drm/radeon/r100.c drivers/gpu/drm/radeon/r100.c
> index 7172746..e4b9770 100644
> --- drivers/gpu/drm/radeon/r100.c
> +++ drivers/gpu/drm/radeon/r100.c
> @@ -584,6 +584,8 @@ static int r100_cp_init_microcode(struct radeon_device *rdev)
>                   (rdev->family = CHIP_RV570)) {
>                DRM_INFO("Loading R500 Microcode\n");
>                fw_name = FIRMWARE_R520;
> +       } else {
> +               return -EINVAL;
>        }
>
>        err = request_firmware(&rdev->me_fw, fw_name, &pdev->dev);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2010-01-07  3:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30  1:24 [PATCH] drm/radeon/r100.c: check for invalid family Darren Jenkins
2010-01-07  3:47 ` Dave Airlie [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=21d7e9971001061947k16ef1367k3c331a8849ce0109@mail.gmail.com \
    --to=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=darrenrjenkins@gmail.com \
    --cc=dri-devel@lists.sourceforge.net \
    --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