mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 22:13:50 +07:00
i40iw: Add NULL check for puda buffer
i40iw_puda_get_listbuf may return NULL if the list is empty. Add NULL check prior to accessing the pointer. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
8c1ea86d44
commit
da5c138185
@ -1025,6 +1025,8 @@ static void i40iw_ieq_compl_pfpdu(struct i40iw_puda_rsrc *ieq,
|
|||||||
u16 txoffset, bufoffset;
|
u16 txoffset, bufoffset;
|
||||||
|
|
||||||
buf = i40iw_puda_get_listbuf(pbufl);
|
buf = i40iw_puda_get_listbuf(pbufl);
|
||||||
|
if (!buf)
|
||||||
|
return;
|
||||||
nextseqnum = buf->seqnum + fpdu_len;
|
nextseqnum = buf->seqnum + fpdu_len;
|
||||||
txbuf->totallen = buf->hdrlen + fpdu_len;
|
txbuf->totallen = buf->hdrlen + fpdu_len;
|
||||||
txbuf->data = (u8 *)txbuf->mem.va + buf->hdrlen;
|
txbuf->data = (u8 *)txbuf->mem.va + buf->hdrlen;
|
||||||
@ -1048,6 +1050,8 @@ static void i40iw_ieq_compl_pfpdu(struct i40iw_puda_rsrc *ieq,
|
|||||||
fpdu_len -= buf->datalen;
|
fpdu_len -= buf->datalen;
|
||||||
i40iw_puda_ret_bufpool(ieq, buf);
|
i40iw_puda_ret_bufpool(ieq, buf);
|
||||||
buf = i40iw_puda_get_listbuf(pbufl);
|
buf = i40iw_puda_get_listbuf(pbufl);
|
||||||
|
if (!buf)
|
||||||
|
return;
|
||||||
bufoffset = (u16)(buf->data - (u8 *)buf->mem.va);
|
bufoffset = (u16)(buf->data - (u8 *)buf->mem.va);
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user