提交 7e0ffee1 编写于 作者: S Stefan Schmidt

net: ieee802154: mcr20a: do not leak resources on error path

We already allocated the device and platform  data at this
point. Instead of simply return from the probe function we
need to cleanup the resources first.
Signed-off-by: NStefan Schmidt <stefan@osg.samsung.com>
Acked-by: NXue Liu <liuxuenetmail@gmail.com>
上级 f9e628a6
...@@ -1309,8 +1309,10 @@ mcr20a_probe(struct spi_device *spi) ...@@ -1309,8 +1309,10 @@ mcr20a_probe(struct spi_device *spi)
/* init buf */ /* init buf */
lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL); lp->buf = devm_kzalloc(&spi->dev, SPI_COMMAND_BUFFER, GFP_KERNEL);
if (!lp->buf) if (!lp->buf) {
return -ENOMEM; ret = -ENOMEM;
goto free_dev;
}
mcr20a_setup_tx_spi_messages(lp); mcr20a_setup_tx_spi_messages(lp);
mcr20a_setup_rx_spi_messages(lp); mcr20a_setup_rx_spi_messages(lp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册