diff --git a/[refs] b/[refs] index 3fcf0c29e441..c9aa9968ea00 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 21168245031062212c0b805d0bd466ee6dd4a16f +refs/heads/master: 5f64a7dbf593c2317f132c8252d04cdfe8d4b104 diff --git a/trunk/net/dsa/dsa.c b/trunk/net/dsa/dsa.c index aa2ff583b7ed..0eb5d5e76dfb 100644 --- a/trunk/net/dsa/dsa.c +++ b/trunk/net/dsa/dsa.c @@ -350,9 +350,11 @@ static void dsa_of_free_platform_data(struct dsa_platform_data *pd) for (i = 0; i < pd->nr_chips; i++) { port_index = 0; - while (pd->chip[i].port_names && - pd->chip[i].port_names[++port_index]) - kfree(pd->chip[i].port_names[port_index]); + while (port_index < DSA_MAX_PORTS) { + if (pd->chip[i].port_names[port_index]) + kfree(pd->chip[i].port_names[port_index]); + port_index++; + } kfree(pd->chip[i].rtable); } kfree(pd->chip);