[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1261660896.3546.43.camel@ICE-BOX>
Date: Fri, 25 Dec 2009 00:21:36 +1100
From: Darren Jenkins <darrenrjenkins@...il.com>
To: David Airlie <airlied@...ux.ie>,
dri-devel mailing list <dri-devel@...ts.sourceforge.net>,
Kernel Janitors <kernel-janitors@...r.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: drivers/gpu/drm/radeon/r100.c: check for invalid family
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.
Coverity CID: 13251
Signed-off-by: Darren Jenkins <darrenrjenkins@...il.com>
diff --git a/drivers/gpu/drm/radeon/r100.c
b/drivers/gpu/drm/radeon/r100.c
index 84e5df7..7d5de31 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists