提交 7d4c0318 编写于 作者: W Wei Yongjun 提交者: Greg Kroah-Hartman

staging: rts5208: fix error return code in rtsx_probe()

Fix to return -ENOMEM instead of 0 when the memory alloc fail
in probe error handling path.
Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6bf2e2a5
......@@ -896,8 +896,10 @@ static int rtsx_probe(struct pci_dev *pci,
memset(dev, 0, sizeof(struct rtsx_dev));
dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
if (dev->chip == NULL)
if (dev->chip == NULL) {
err = -ENOMEM;
goto errout;
}
spin_lock_init(&dev->reg_lock);
mutex_init(&(dev->dev_mutex));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册