Skip to content

Commit 1f74714

Browse files
Fabian Frederickdavem330
authored andcommitted
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" <[email protected]> Cc: Grant Likely <[email protected]> Cc: [email protected] Cc: Joe Perches <[email protected]> Signed-off-by: Fabian Frederick <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cb8eb77 commit 1f74714

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/dsa/dsa.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,7 @@ static void dsa_of_free_platform_data(struct dsa_platform_data *pd)
351351
for (i = 0; i < pd->nr_chips; i++) {
352352
port_index = 0;
353353
while (port_index < DSA_MAX_PORTS) {
354-
if (pd->chip[i].port_names[port_index])
355-
kfree(pd->chip[i].port_names[port_index]);
354+
kfree(pd->chip[i].port_names[port_index]);
356355
port_index++;
357356
}
358357
kfree(pd->chip[i].rtable);

0 commit comments

Comments
 (0)