summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAymen Qader <qader.aymen@gmail.com>2018-09-29 20:24:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-03 01:18:36 +0300
commit3e15dddeadcbe45adc654d11f38191e76feacd05 (patch)
treed70ef5f5423cc5d08ecdc43bb90a03779628d0ff /drivers
parentee607b8fb54b566c3038c18264d3e8560d66b4ec (diff)
downloadlinux-3e15dddeadcbe45adc654d11f38191e76feacd05.tar.xz
staging: rtlwifi: Return -ENOMEM instead of -1
Use the ENOMEM constant instead of -1 for kzalloc failure checks in rtl_halmac.c Signed-off-by: Aymen Qader <qader.aymen@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtlwifi/halmac/rtl_halmac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtlwifi/halmac/rtl_halmac.c b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
index f0c6fc8c6aca..7bfc9620479a 100644
--- a/drivers/staging/rtlwifi/halmac/rtl_halmac.c
+++ b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
@@ -209,7 +209,7 @@ static int init_halmac_event_with_waittime(struct rtl_priv *rtlpriv,
if (!rtlpriv->halmac.indicator[id].comp) {
comp = kzalloc(sizeof(*comp), GFP_KERNEL);
if (!comp)
- return -1;
+ return -ENOMEM;
} else {
RT_TRACE(rtlpriv, COMP_HALMAC, DBG_LOUD,
"%s: <WARN> id(%d) sctx is not NULL!!\n", __func__,
@@ -359,7 +359,7 @@ static int init_priv(struct rtl_halmac *halmac)
size = sizeof(*indicator) * count;
indicator = kzalloc(size, GFP_KERNEL);
if (!indicator)
- return -1;
+ return -ENOMEM;
halmac->indicator = indicator;
return 0;