Skip to content

Commit

Permalink
spi: clps711x: Don't call kfree() after spi_master_put/spi_unregister…
Browse files Browse the repository at this point in the history
…_master

Calling kfree() to clean up the memory obtained from spi_alloc_master() is
wrong as this is done in spi_master_release() when spi_master->dev's refcount
reaches zero.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Sep 10, 2013
1 parent 5787392 commit 9b4003a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/spi/spi-clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ static int spi_clps711x_probe(struct platform_device *pdev)
gpio_free(hw->chipselect[i]);

spi_master_put(master);
kfree(master);

return ret;
}
Expand All @@ -263,7 +262,6 @@ static int spi_clps711x_remove(struct platform_device *pdev)
gpio_free(hw->chipselect[i]);

spi_unregister_master(master);
kfree(master);

return 0;
}
Expand Down

0 comments on commit 9b4003a

Please sign in to comment.