提交 c7e62def 编写于 作者: K Kulikov Vasiliy 提交者: Greg Kroah-Hartman

staging: adis16255: fix sysfs leak

Original code does not call sysfs_remove_group() on error. This can lead
to NULL dereference.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 cd6541c0
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册