Thread (118 messages) 118 messages, 10 authors, 2021-08-30

Re: [PATCH RFC 1/3] staging: r8188eu: add proper rtw_read* error handling

From: Pavel Skripkin <hidden>
Date: 2021-08-20 21:50:46
Also in: lkml

On 8/20/21 8:07 PM, Pavel Skripkin wrote:
[snip]
quoted hunk ↗ jump to hunk
@@ -336,13 +338,21 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
  
  	memset(c2h_evt, 0, 16);
  
-	*buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL);
-	*(buf + 1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1);
+	*buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL, &error);
+	if (error)
+		goto clear_evt;
+
+	*(buf + 1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1, &error);
+	if (error)
+		;
	 ^^^^^^^

Should be goto clear_evt;. Will fix in v2, I want to receive some 
feedback first :)



With regards,
Pavel Skripkin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help