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>
This commit is contained in:
parent
ee607b8fb5
commit
3e15dddead
@ -209,7 +209,7 @@ static int init_halmac_event_with_waittime(struct rtl_priv *rtlpriv,
|
|||||||
if (!rtlpriv->halmac.indicator[id].comp) {
|
if (!rtlpriv->halmac.indicator[id].comp) {
|
||||||
comp = kzalloc(sizeof(*comp), GFP_KERNEL);
|
comp = kzalloc(sizeof(*comp), GFP_KERNEL);
|
||||||
if (!comp)
|
if (!comp)
|
||||||
return -1;
|
return -ENOMEM;
|
||||||
} else {
|
} else {
|
||||||
RT_TRACE(rtlpriv, COMP_HALMAC, DBG_LOUD,
|
RT_TRACE(rtlpriv, COMP_HALMAC, DBG_LOUD,
|
||||||
"%s: <WARN> id(%d) sctx is not NULL!!\n", __func__,
|
"%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;
|
size = sizeof(*indicator) * count;
|
||||||
indicator = kzalloc(size, GFP_KERNEL);
|
indicator = kzalloc(size, GFP_KERNEL);
|
||||||
if (!indicator)
|
if (!indicator)
|
||||||
return -1;
|
return -ENOMEM;
|
||||||
halmac->indicator = indicator;
|
halmac->indicator = indicator;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user