* [PATCH] drm/radeon/radeon_cp.c: check for invalid radeon family
@ 2009-12-30 1:23 Darren Jenkins
2010-01-07 3:48 ` Dave Airlie
0 siblings, 1 reply; 2+ messages in thread
From: Darren Jenkins @ 2009-12-30 1:23 UTC (permalink / raw)
To: David Airlie, dri-devel mailing list, Kernel Janitors
Cc: Linux Kernel Mailing List
If there is an invalid radeon family the fw_name is NULL and causes an
NULL pointer dereference.
This just adds a check for something unexpected.
Coverity CID: 13252
Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
diff --git drivers/gpu/drm/radeon/radeon_cp.c drivers/gpu/drm/radeon/radeon_cp.c
index 0b2f9c2..1e66337 100644
--- drivers/gpu/drm/radeon/radeon_cp.c
+++ drivers/gpu/drm/radeon/radeon_cp.c
@@ -531,6 +531,8 @@ static int radeon_cp_init_microcode(drm_radeon_private_t *dev_priv)
((dev_priv->flags & RADEON_FAMILY_MASK) = CHIP_RV570)) {
DRM_INFO("Loading R500 Microcode\n");
fw_name = FIRMWARE_R520;
+ } else {
+ return -EINVAL;
}
err = request_firmware(&dev_priv->me_fw, fw_name, &pdev->dev);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/radeon/radeon_cp.c: check for invalid radeon family
2009-12-30 1:23 [PATCH] drm/radeon/radeon_cp.c: check for invalid radeon family Darren Jenkins
@ 2010-01-07 3:48 ` Dave Airlie
0 siblings, 0 replies; 2+ messages in thread
From: Dave Airlie @ 2010-01-07 3:48 UTC (permalink / raw)
To: Darren Jenkins
Cc: David Airlie, dri-devel mailing list, Kernel Janitors,
Linux Kernel Mailing List
On Wed, Dec 30, 2009 at 11:23 AM, Darren Jenkins
<darrenrjenkins@gmail.com> wrote:
> If there is an invalid radeon family the fw_name is NULL and causes an
> NULL pointer dereference.
> This just adds a check for something unexpected.
>
Same as for last one, unless a developer explicity writes code wrong,
this cannot
happen, and I'd prefer a developer would see an oops.
Dave.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-07 3:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30 1:23 [PATCH] drm/radeon/radeon_cp.c: check for invalid radeon family Darren Jenkins
2010-01-07 3:48 ` Dave Airlie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox