[PATCH] drm/radeon/radeon_cp.c: fix resource leak on error

2009-12-29 Thread Darren Jenkins
If drm_addmap() fails master_priv is leaked. Coverity CID: 13195 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/radeon_cp.c drivers/gpu/drm/radeon/radeon_cp.c index 0b2f9c2..06123ba 100644 --- drivers/gpu/drm/radeon/radeon_cp.c +++ drivers/gpu/drm

[PATCH] drm/radeon/radeon_device.c: move a dereference below a NULL test

2009-12-29 Thread Darren Jenkins
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13335 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/radeon_device.c drivers/gpu/drm/radeon/radeon_device.c index 7c68480..0c51f8e 100644 --- drivers/gpu

[PATCH] drm/radeon: fix a couple of array index errors

2009-12-29 Thread Darren Jenkins
There are a couple of array overruns, and some associated confusion in the code. This is just a wild guess at what the code should actually look like. Coverity CID: 13305 13306 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/radeon_legacy_tv.c drivers

[PATCH] gpu/drm/radeon/radeon_irq.c: move a dereference below a NULL test

2009-12-29 Thread Darren Jenkins
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13338 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/radeon_irq.c drivers/gpu/drm/radeon/radeon_irq.c index b79ecc4..2f349a3 100644 --- drivers/gpu/drm

[PATCH] drm/radeon/radeon_fence.c: move a dereference below the NULL test

2009-12-29 Thread Darren Jenkins
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13334 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/radeon_fence.c drivers/gpu/drm/radeon/radeon_fence.c index 4cdd8b4..f3a8380 100644 --- drivers/gpu

[PATCH] drm/radeon/r100.c: check for invalid family

2009-12-29 Thread Darren Jenkins
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 darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/r100.c drivers/gpu/drm/radeon/r100.c index

[PATCH] drm/radeon/radeon_connectors.c: add a NULL test before dereference

2009-12-29 Thread Darren Jenkins
The encoder variable can be NULL in this function so I believe it should be checked before dereference. Coverity CID: 13253 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git drivers/gpu/drm/radeon/radeon_connectors.c drivers/gpu/drm/radeon/radeon_connectors.c index 2016156

drivers/gpu/drm/radeon/radeon_connectors.c: add a NULL test before dereference

2009-12-24 Thread Darren Jenkins
The encoder variable can be NULL in this function so I believe it should be checked before dereference. Coverity CID: 13253 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 5eece18

drivers/gpu/drm/radeon/radeon_fence.c: move a dereference below the NULL test

2009-12-24 Thread Darren Jenkins
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13334 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index cb4cd97..f4f5942 100644 --- a/drivers

drivers/gpu/drm/radeon/radeon_cp.c: check for invalid radeon family

2009-12-24 Thread Darren Jenkins
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 darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon

drivers/gpu/drm/radeon: fix a couple of array index errors

2009-12-24 Thread Darren Jenkins
There are a couple of array overruns, and some associated confusion in the code. This is just a wild guess at what the code should actually look like. Coverity CID: 13305 13306 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_legacy_tv.c b

drivers/gpu/drm/radeon/radeon_device.c: move a dereference below a NULL test

2009-12-24 Thread Darren Jenkins
If a NULL value is possible, the dereference should only occur after the NULL test. Coverity CID: 13335 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 02bcdb1..c0104b0 100644 --- a/drivers

drivers/gpu/drm/radeon: move a dereference below a NULL test

2009-12-24 Thread Darren Jenkins
If a NULL value is possible, the dereference should only occur after the NULL test. Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c index b79ecc4..2f349a3 100644 --- a/drivers/gpu/drm/radeon/radeon_irq.c

drivers/gpu/drm/radeon/r100.c: check for invalid family

2009-12-24 Thread Darren Jenkins
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 darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index

drivers/gpu/drm/radeon/radeon_cp.c: fix resource leak on error

2009-12-24 Thread Darren Jenkins
If drm_addmap() fails master_priv is leaked. Coverity CID: 13195 Signed-off-by: Darren Jenkins darrenrjenk...@gmail.com diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 0b2f9c2..06123ba 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu