From: Wei Yongjun Date: Wed, 27 Nov 2013 00:38:19 +0000 (+0800) Subject: staging: rts5208: fix error return code in rtsx_probe() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7d4c0318f121bbba25d76fddd2f5ba3c01f318a6;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Greg Kroah-Hartman --- 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));