ARM: SAMSUNG: Fix null pointer dereference in ADC driver
authorMaurus Cuelenaere <mcuelenaere@gmail.com>
Fri, 22 Jan 2010 22:29:16 +0000 (23:29 +0100)
committerBen Dooks <ben-linux@fluff.org>
Tue, 26 Jan 2010 00:50:03 +0000 (09:50 +0900)
ARM: SAMSUNG: Fix null pointer dereference in ADC driver

Use struct adc_device instead of relying on client (which could be
NULL) when checking for SoC type.

Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
arch/arm/plat-samsung/adc.c

index 120b7902fc2fd02a6b55512cbfaf74d296ac4775..c7659b7378b1f137d368712f44fae46b14e6d307 100644 (file)
@@ -295,7 +295,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
        }
 
 exit:
-       if (platform_get_device_id(client->pdev)->driver_data == TYPE_S3C64XX) {
+       if (platform_get_device_id(adc->pdev)->driver_data == TYPE_S3C64XX) {
                /* Clear ADC interrupt */
                writel(0, adc->regs + S3C64XX_ADCCLRINT);
        }