bnxt_en: Fix uninitialized variable usage in bnxt_rx_pkt().
authorMichael Chan <michael.chan@broadcom.com>
Fri, 26 Apr 2019 02:31:55 +0000 (22:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 May 2019 12:42:40 +0000 (14:42 +0200)
commitf1fd68e934091734c21e3ea21748d272f08b3fee
tree9c32d63f98fd1fa786748e2bbc173f14114aeb6a
parent396350737326d0e54c848ae14e4eb7160592633d
bnxt_en: Fix uninitialized variable usage in bnxt_rx_pkt().

[ Upstream commit 0b397b17a4120cb80f7bf89eb30587b3dd9b0d1d ]

In bnxt_rx_pkt(), if the driver encounters BD errors, it will recycle
the buffers and jump to the end where the uninitailized variable "len"
is referenced.  Fix it by adding a new jump label that will skip
the length update.  This is the most correct fix since the length
may not be valid when we get this type of error.

Fixes: 6a8788f25625 ("bnxt_en: add support for software dynamic interrupt moderation")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c