Staging
v0.5.1
https://github.com/torvalds/linux
Revision 9b9ba821b6c47b6d1a711b8f6fff931277217bab authored by Tobias Klauser on 14 August 2014, 11:59:42 UTC, committed by David S. Miller on 14 August 2014, 21:38:54 UTC
xgene_enet_get_ring_size() returns a negative value in case of an error,
but its only caller in xgene_enet_create_desc_ring() currently uses the
return value directly as u32. Instead, check for a negative value first and
error out in case. Also move the call to xgene_enet_get_ring_size() before
devm_kzalloc() so we don't need to free anything in the error path.

This fixes the following issue reported by the Coverity Scanner:

** CID 1231336:  Improper use of negative value  (NEGATIVE_RETURNS)
/drivers/net/ethernet/apm/xgene/xgene_enet_main.c: 596 in xgene_enet_create_desc_ring()

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9d186ca
History
Tip revision: 9b9ba821b6c47b6d1a711b8f6fff931277217bab authored by Tobias Klauser on 14 August 2014, 11:59:42 UTC
net: xgene: Check negative return value of xgene_enet_get_ring_size()
Tip revision: 9b9ba82
File Mode Size
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore -rw-r--r-- 1.1 KB
.mailmap -rw-r--r-- 4.7 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 93.8 KB
Kbuild -rw-r--r-- 2.5 KB
Kconfig -rw-r--r-- 252 bytes
MAINTAINERS -rw-r--r-- 277.8 KB
Makefile -rw-r--r-- 52.1 KB
README -rw-r--r-- 18.3 KB
REPORTING-BUGS -rw-r--r-- 7.3 KB

README

back to top