* drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family
@ 2009-12-24 13:18 ` Darren Jenkins
0 siblings, 0 replies; 5+ messages in thread
From: Darren Jenkins @ 2009-12-24 13:18 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 a/drivers/gpu/drm/radeon/radeon_cp.c
b/drivers/gpu/drm/radeon/radeon_cp.c
index 0b2f9c2..1e66337 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/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] 5+ messages in thread* drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family
@ 2009-12-24 13:18 ` Darren Jenkins
0 siblings, 0 replies; 5+ messages in thread
From: Darren Jenkins @ 2009-12-24 13:18 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 a/drivers/gpu/drm/radeon/radeon_cp.c
b/drivers/gpu/drm/radeon/radeon_cp.c
index 0b2f9c2..1e66337 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/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] 5+ messages in thread* Re: drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon
2009-12-24 13:18 ` Darren Jenkins
(?)
@ 2010-01-13 8:40 ` walter harms
-1 siblings, 0 replies; 5+ messages in thread
From: walter harms @ 2010-01-13 8:40 UTC (permalink / raw)
To: Darren Jenkins
Cc: David Airlie, dri-devel mailing list, Kernel Janitors,
Linux Kernel Mailing List
Darren Jenkins schrieb:
> 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 a/drivers/gpu/drm/radeon/radeon_cp.c
> b/drivers/gpu/drm/radeon/radeon_cp.c
> index 0b2f9c2..1e66337 100644
> --- a/drivers/gpu/drm/radeon/radeon_cp.c
> +++ b/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);
>
>
Someone should take the job to clear the if forrest and replace it with switch()/case.
just my 2 cents,
wh
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family
@ 2010-01-13 8:40 ` walter harms
0 siblings, 0 replies; 5+ messages in thread
From: walter harms @ 2010-01-13 8:40 UTC (permalink / raw)
To: Darren Jenkins
Cc: David Airlie, dri-devel mailing list, Kernel Janitors,
Linux Kernel Mailing List
Darren Jenkins schrieb:
> 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 a/drivers/gpu/drm/radeon/radeon_cp.c
> b/drivers/gpu/drm/radeon/radeon_cp.c
> index 0b2f9c2..1e66337 100644
> --- a/drivers/gpu/drm/radeon/radeon_cp.c
> +++ b/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);
>
>
Someone should take the job to clear the if forrest and replace it with switch()/case.
just my 2 cents,
wh
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
--
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family
@ 2010-01-13 8:40 ` walter harms
0 siblings, 0 replies; 5+ messages in thread
From: walter harms @ 2010-01-13 8:40 UTC (permalink / raw)
To: Darren Jenkins
Cc: David Airlie, dri-devel mailing list, Kernel Janitors,
Linux Kernel Mailing List
Darren Jenkins schrieb:
> 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 a/drivers/gpu/drm/radeon/radeon_cp.c
> b/drivers/gpu/drm/radeon/radeon_cp.c
> index 0b2f9c2..1e66337 100644
> --- a/drivers/gpu/drm/radeon/radeon_cp.c
> +++ b/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);
>
>
Someone should take the job to clear the if forrest and replace it with switch()/case.
just my 2 cents,
wh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-13 9:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-24 13:18 drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family Darren Jenkins
2009-12-24 13:18 ` Darren Jenkins
2010-01-13 8:40 ` drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon walter harms
2010-01-13 8:40 ` drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family walter harms
2010-01-13 8:40 ` walter harms
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.