Hi Dmitry,

I took a look at the driver in your next tree.

Two issues:
-Avoid NULL pointer dereference in adp5588_gpio_add(),
set clientdata before call to adp5588_gpio_add().
-Avoid NULL pointer dereference, exit if gpio_data doesn't exist

Signed-off-by: Michael Hennerich <michael.henner...@analog.com>

drivers/input/keyboard/adp5588-keys.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/adp5588-keys.c 
b/drivers/input/keyboard/adp5588-keys.c
index c39ec93..456bba7 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -201,6 +201,9 @@ static int __devinit adp5588_gpio_add(struct device *dev)

                if (kpad->gc.ngpio)
                        kpad->export_gpio = true;
+       } else {
+               kpad->export_gpio = false;
+               return 0;
        }

        if (!kpad->export_gpio) {
@@ -581,12 +584,13 @@ static int __devinit adp5588_probe(struct i2c_client 
*client,
        if (kpad->gpimapsize)
                adp5588_report_switch_state(kpad);

+       i2c_set_clientdata(client, kpad);
+
        error = adp5588_gpio_add(&client->dev);
        if (error)
                goto err_free_irq;

        device_init_wakeup(&client->dev, 1);
-       i2c_set_clientdata(client, kpad);

        dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
        return 0;

Greetings,
Michael

Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif

_______________________________________________
Uclinux-dist-devel mailing list
Uclinux-dist-devel@blackfin.uclinux.org
https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel

Reply via email to