Skip to contentSkip to conversation

staging: rtl8192e: Clean up the tests on the results of functions which return NULL on failure

PATCH Superseded pooja.shamili 1 participant 1 message Feb 27, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192e: Clean up the tests on the results of functions which return NULL on failure

Functions returning NULL as a return value on failure can be tested for as !x, NULL == x or x == NULL. As !x is commonly used, all the tests need to be modified to use !x for a consistent coding style. In this patch, the function kzalloc is considered.

---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c +1 -1
index 496de4f..5b893e4 100644
@@ -63,7 +63,7 @@ static void *rtllib_ccmp_init(int key_idx)
 	struct rtllib_ccmp_data *priv;
 
 	priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
-	if (priv == NULL)
+	if (!priv)
 		goto fail;
 	priv->key_idx = key_idx;
 
Signature · 1 line
2.1.4