diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-08-11 08:00:48 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-31 21:51:53 (GMT) |
commit | c7e62defd3c4a015b1f80a642bc320b9f9f3896c (patch) | |
tree | fcef9fed59ff0cf1eee18519d97f61bcad5b7b6c | |
parent | cd6541c03d0777963615d00b22ff8a4c8ee8d601 (diff) | |
download | linux-c7e62defd3c4a015b1f80a642bc320b9f9f3896c.tar.xz |
staging: adis16255: fix sysfs leak
Original code does not call sysfs_remove_group() on error. This can lead
to NULL dereference.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/adis16255/adis16255.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/adis16255/adis16255.c b/drivers/staging/adis16255/adis16255.c index c3e6a4d..8d4d7cb 100644 --- a/drivers/staging/adis16255/adis16255.c +++ b/drivers/staging/adis16255/adis16255.c @@ -406,12 +406,14 @@ static int __devinit spi_adis16255_probe(struct spi_device *spi) status = spi_adis16255_bringup(spiadis); if (status != 0) - goto irq_err; + goto sysfs_err; dev_info(&spi->dev, "spi_adis16255 driver added!\n"); return status; +sysfs_err: + sysfs_remove_group(&spiadis->spi->dev.kobj, &adis16255_attr_group); irq_err: free_irq(spiadis->irq, spiadis); gpio_err: |