* [PATCH] staging: rtlwifi: Return -ENOMEM instead of -1
@ 2018-09-29 17:24 Aymen Qader
0 siblings, 0 replies; only message in thread
From: Aymen Qader @ 2018-09-29 17:24 UTC (permalink / raw)
Cc: Larry Finger, Aymen Qader, Greg Kroah-Hartman, devel, linux-kernel
Use the ENOMEM constant instead of -1 for kzalloc failure checks in
rtl_halmac.c
Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
---
drivers/staging/rtlwifi/halmac/rtl_halmac.c | 4 ++--
1 file 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;
--
2.17.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-29 17:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-29 17:24 [PATCH] staging: rtlwifi: Return -ENOMEM instead of -1 Aymen Qader
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome