OSDN Git Service

net/dsa/dsa.c: remove unnecessary null test before kfree
authorFabian Frederick <fabf@skynet.be>
Mon, 23 Jun 2014 17:32:47 +0000 (19:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jun 2014 23:15:16 +0000 (16:15 -0700)
Fix checkpatch warning:
WARNING: kfree(NULL) is safe this check is probably not required

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: netdev@vger.kernel.org
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa.c

index 5db37ce..0a49632 100644 (file)
@@ -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);