From: Dan Carpenter Date: Tue, 27 Aug 2013 01:16:22 +0000 (+0300) Subject: qlcnic: underflow in qlcnic_validate_max_tx_rings() X-Git-Tag: v3.12-rc1~132^2~164 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80b17be70b63646cb141bf1826afe32281e561ec;p=pandora-kernel.git qlcnic: underflow in qlcnic_validate_max_tx_rings() This function checks the upper bound but it doesn't check for negative numbers: if (txq > QLCNIC_MAX_TX_RINGS) { I've solved this by making "txq" a u32 type. I chose that because ->tx_count in the ethtool_channels struct is a __u32. This bug was added in aa4a1f7df7 ('qlcnic: Enable Tx queue changes using ethtool for 82xx Series adapter.'). Signed-off-by: Dan Carpenter Acked-by: Himanshu Madhani Signed-off-by: David S. Miller --- Reading git-diff-tree failed