diff --git a/[refs] b/[refs] index e478f65810ed..68c53537afdd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 632d8e55d1f0304579315669bfadcab7352973fd +refs/heads/master: f39f54af032ce900815d0d718df5f1717eed50fe diff --git a/trunk/drivers/gpio/gpio-pcf857x.c b/trunk/drivers/gpio/gpio-pcf857x.c index a965620c1c2a..e8faf53f3875 100644 --- a/trunk/drivers/gpio/gpio-pcf857x.c +++ b/trunk/drivers/gpio/gpio-pcf857x.c @@ -268,7 +268,7 @@ static int pcf857x_probe(struct i2c_client *client, } /* Allocate, initialize, and register this gpio_chip. */ - gpio = kzalloc(sizeof *gpio, GFP_KERNEL); + gpio = devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL); if (!gpio) return -ENOMEM; @@ -391,7 +391,6 @@ static int pcf857x_probe(struct i2c_client *client, if (pdata && client->irq) pcf857x_irq_domain_cleanup(gpio); - kfree(gpio); return status; } @@ -416,9 +415,7 @@ static int pcf857x_remove(struct i2c_client *client) pcf857x_irq_domain_cleanup(gpio); status = gpiochip_remove(&gpio->chip); - if (status == 0) - kfree(gpio); - else + if (status) dev_err(&client->dev, "%s --> %d\n", "remove", status); return status; }