diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-11-27 08:38:19 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-03 09:03:20 -0800 |
commit | 7d4c0318f121bbba25d76fddd2f5ba3c01f318a6 (patch) | |
tree | 244dcc9972f982d8bd7bef7c1a1b28260f5e95cc /drivers | |
parent | 6bf2e2a59769264f40c75a31b07603faab9460b5 (diff) | |
download | blackbird-op-linux-7d4c0318f121bbba25d76fddd2f5ba3c01f318a6.tar.gz blackbird-op-linux-7d4c0318f121bbba25d76fddd2f5ba3c01f318a6.zip |
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rts5208/rtsx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index 7882f578a8d9..8586ac5d2144 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -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)); |