Commit 3e15ddde authored by Aymen Qader's avatar Aymen Qader Committed by Greg Kroah-Hartman
Browse files

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: default avatarAymen Qader <qader.aymen@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee607b8f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;