Skip to content

Commit

Permalink
staging: adis16255: fix sysfs leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Aug 31, 2010
1 parent cd6541c commit c7e62de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/adis16255/adis16255.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c7e62de

Please sign in to comment.