From: Alexander Beregalov Date: Sat, 26 Mar 2011 17:18:10 +0000 (+0300) Subject: Staging: sbe-2t3e3: redundant null check before kfree() X-Git-Tag: firefly_0821_release~7613^2~1326^2~809 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=24c92eac7e5976b07f663e1149d73075aff96c0d;p=firefly-linux-kernel-4.4.55.git Staging: sbe-2t3e3: redundant null check before kfree() Signed-off-by: Alexander Beregalov Cc: Krzysztof Halasa Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/sbe-2t3e3/dc.c b/drivers/staging/sbe-2t3e3/dc.c index dc53016d546c..9dc4ec2109eb 100644 --- a/drivers/staging/sbe-2t3e3/dc.c +++ b/drivers/staging/sbe-2t3e3/dc.c @@ -442,15 +442,10 @@ void dc_drop_descriptor_list(struct channel *sc) } } - if (sc->ether.rx_ring != NULL) { - kfree(sc->ether.rx_ring); - sc->ether.rx_ring = NULL; - } - - if (sc->ether.tx_ring != NULL) { - kfree(sc->ether.tx_ring); - sc->ether.tx_ring = NULL; - } + kfree(sc->ether.rx_ring); + sc->ether.rx_ring = NULL; + kfree(sc->ether.tx_ring); + sc->ether.tx_ring = NULL; }