summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208/rtsx.c
diff options
context:
space:
mode:
authorWei Yongjun2013-11-27 01:38:19 +0100
committerGreg Kroah-Hartman2013-12-03 18:03:20 +0100
commit7d4c0318f121bbba25d76fddd2f5ba3c01f318a6 (patch)
tree244dcc9972f982d8bd7bef7c1a1b28260f5e95cc /drivers/staging/rts5208/rtsx.c
parentStaging: dwc2: hcd.c: Fixed a coding style issue (diff)
downloadkernel-qcow2-linux-7d4c0318f121bbba25d76fddd2f5ba3c01f318a6.tar.gz
kernel-qcow2-linux-7d4c0318f121bbba25d76fddd2f5ba3c01f318a6.tar.xz
kernel-qcow2-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/staging/rts5208/rtsx.c')
-rw-r--r--drivers/staging/rts5208/rtsx.c4
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));