提交 2c10efbd 编写于 作者: B Bhaktipriya Shridhar 提交者: Greg Kroah-Hartman

staging: rtl8188eu: os_dep: Remove NULL test before vfree

vfree frees the virtually continuous memory area starting at addr.
If addr is NULL, no operation is performed. So NULL test is not needed
before vfree.

This was done using Coccinelle:

@@
expression x;
@@
-if (x != NULL)
    vfree(x);

@@
expression x;
@@

-if (x != NULL) {
vfree(x);
x = NULL;
-}
Signed-off-by: NBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7570ad91
...@@ -442,7 +442,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, ...@@ -442,7 +442,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
if (status != _SUCCESS) { if (status != _SUCCESS) {
if (pnetdev) if (pnetdev)
rtw_free_netdev(pnetdev); rtw_free_netdev(pnetdev);
else if (padapter) else
vfree(padapter); vfree(padapter);
padapter = NULL; padapter = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册