From: Fabian Frederick Date: Mon, 23 Jun 2014 17:32:47 +0000 (+0200) Subject: net/dsa/dsa.c: remove unnecessary null test before kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f74714f1e34a84fe4ef2a6d9b76c20794fb5dcf;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git net/dsa/dsa.c: remove unnecessary null test before kfree Fix checkpatch warning: WARNING: kfree(NULL) is safe this check is probably not required Cc: "David S. Miller" Cc: Grant Likely Cc: netdev@vger.kernel.org Cc: Joe Perches Signed-off-by: Fabian Frederick Signed-off-by: David S. Miller --- diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 5db37cef50a9..0a49632fac47 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -351,8 +351,7 @@ static void dsa_of_free_platform_data(struct dsa_platform_data *pd) for (i = 0; i < pd->nr_chips; i++) { port_index = 0; while (port_index < DSA_MAX_PORTS) { - if (pd->chip[i].port_names[port_index]) - kfree(pd->chip[i].port_names[port_index]); + kfree(pd->chip[i].port_names[port_index]); port_index++; } kfree(pd->chip[i].rtable);