From c7e62defd3c4a015b1f80a642bc320b9f9f3896c Mon Sep 17 00:00:00 2001 From: Kulikov Vasiliy Date: Wed, 11 Aug 2010 12:00:48 +0400 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/adis16255/adis16255.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/adis16255/adis16255.c b/drivers/staging/adis16255/adis16255.c index c3e6a4d5f334..8d4d7cbab979 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: