gpio: langwell: fix possible null pointer dereference.
authorAxel Haslam <axelx.haslam@intel.com>
Tue, 7 Feb 2012 11:18:59 +0000 (12:18 +0100)
committerbuildbot <buildbot@intel.com>
Fri, 10 Feb 2012 06:42:28 +0000 (22:42 -0800)
BZ: 22932

The function checks for null and then makes a dereference
of the same pointer. This is a no-no.

Change-Id: I30e10396e13f5f69cfe5a01d30526c840286da08
Signed-off-by: Axel Haslam <axelx.haslam@intel.com>
Reviewed-on: http://android.intel.com:8080/34277
Reviewed-by: Koskinen, Ilkka <ilkka.koskinen@intel.com>
Reviewed-by: Yang, Bin <bin.yang@intel.com>
Reviewed-by: Li, Ning <ning.li@intel.com>
Reviewed-by: Fiat, Christophe <christophe.fiat@intel.com>
Tested-by: Wang, Zhifeng <zhifeng.wang@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/gpio/langwell_gpio.c

index 6c34e9d..6610493 100644 (file)
@@ -92,7 +92,7 @@ void lnw_gpio_set_alt(int gpio, int alt)
        /* use this trick to get memio */
        lnw = irq_get_chip_data(gpio_to_irq(gpio));
        if (!lnw) {
-               dev_err(lnw->chip.dev, "langwell_gpio: can not find pin %d\n", gpio);
+               pr_err("langwell_gpio: can not find pin %d\n", gpio);
                return;
        }
        if (gpio < lnw->chip.base || gpio >= lnw->chip.base + lnw->chip.ngpio) {