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

Pavel Skripkin
2021-08-20T21:50:42Z

On 8/20/21 8:07 PM, Pavel Skripkin wrote:
[snip]

> @@ -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