qed: use kzalloc instead of kmalloc and memset

Replace kmalloc followed by a memset with kzalloc

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ariel Elior <aelior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Colin Ian King 2017-11-15 14:03:20 +00:00 committed by David S. Miller
parent 0a833c29d8
commit c61a75ac1a
1 changed files with 1 additions and 2 deletions

View File

@ -1277,11 +1277,10 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn,
{
struct qed_dcbx_get *dcbx_info;
dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC);
dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_ATOMIC);
if (!dcbx_info)
return NULL;
memset(dcbx_info, 0, sizeof(*dcbx_info));
if (qed_dcbx_query_params(hwfn, dcbx_info, type)) {
kfree(dcbx_info);
return NULL;