提交 57a42192 编写于 作者: L Lidza Louina 提交者: Greg Kroah-Hartman

staging: dgap: driver.c: removes smatch warning "redundant null check"

This patch removes these smatch warnings from dgap_driver.c:

redundant null check on dgap_config_buf calling kfree()
redundant null check on brd->flipbuf calling kfree()
redundant null check on brd->flipflagbuf calling kfree()
Signed-off-by: NLidza Louina <lidza.louina@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6319c61a
......@@ -416,8 +416,7 @@ void dgap_cleanup_module(void)
unregister_chrdev(DIGI_DGAP_MAJOR, "dgap");
}
if (dgap_config_buf)
kfree(dgap_config_buf);
kfree(dgap_config_buf);
for (i = 0; i < dgap_NumBoards; ++i) {
dgap_remove_ports_sysfiles(dgap_Board[i]);
......@@ -484,10 +483,8 @@ static void dgap_cleanup_board(struct board_t *brd)
}
}
if (brd->flipbuf)
kfree(brd->flipbuf);
if (brd->flipflagbuf)
kfree(brd->flipflagbuf);
kfree(brd->flipbuf);
kfree(brd->flipflagbuf);
dgap_Board[brd->boardnum] = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册