]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Return error when allocating zero size context memory.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 26 Apr 2020 20:24:41 +0000 (16:24 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Apr 2020 18:44:05 +0000 (11:44 -0700)
commitbe03d12503ee86fc1a43c353da9181d0ecfa3503
treecb56ce996e8abb9182dc7e5a57fcc63fa1bb099b
parent8cb6bc6319d70636db7598ee9b6df95c725cf2ee
bnxt_en: Return error when allocating zero size context memory.

bnxt_alloc_ctx_pg_tbls() should return error when the memory size of the
context memory to set up is zero.  By returning success (0), the caller
may proceed normally and may crash later when it tries to set up the
memory.

Fixes: 46294549b081 ("bnxt_en: Add Level 2 context memory paging support.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c