Skip to contentSkip to conversation

staging: rtl8723bs: hal: Remove typecast in call to kfree

PATCH In review Nachammai Karuppiah 2 participants 2 messages Oct 24, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: hal: Remove typecast in call to kfree

Remove typecast in the call to kfree as it is not needed. Issue found using coccinelle.

---
 drivers/staging/rtl8723bs/hal/sdio_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/sdio_ops.c +1 -1
index 301d327..5645658 100644
@@ -1029,7 +1029,7 @@ void sd_int_dpc(struct adapter *adapter)
 				if (c2h_id_filter_ccx_8723b((u8 *)c2h_evt)) {
 					/* Handle CCX report here */
 					rtw_hal_c2h_handler(adapter, (u8 *)c2h_evt);
-					kfree((u8 *)c2h_evt);
+					kfree(c2h_evt);
 				} else {
 					rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt);
 				}
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Nachammai Karuppiah

Remove typecast in the call to kfree as it is not needed. Issue found using coccinelle.

---
 drivers/staging/rtl8723bs/hal/sdio_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/sdio_ops.c +0 -0
index 301d327..5645658 100644

drivers/staging/rtl8723bs/hal/sdio_ops.c void sd_int_dpc(struct adapter *adapter) · line 1032

Quoted 5 lines
drivers/staging/rtl8723bs/hal/sdio_ops.c +1 -1
@@ -1029,7 +1029,7 @@ void sd_int_dpc(struct adapter *adapter)
 				if (c2h_id_filter_ccx_8723b((u8 *)c2h_evt)) {
 					/* Handle CCX report here */
 					rtw_hal_c2h_handler(adapter, (u8 *)c2h_evt);
-					kfree((u8 *)c2h_evt);
+					kfree(c2h_evt);

Is your kernel up to date? For me, the patch applied with a large offset.

It could be good to look into whether the other casts are really needed.

julia

Quoted 11 lines
drivers/staging/rtl8723bs/hal/sdio_ops.c +0 -1
 				} else {
 					rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt);
 				}
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1571934370-39013-1-git-send-email-nachukannan%40gmail.com.