diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 0087139090e4828beb0352ae8d4bf4dfb258189c..c6ad4e1c3dc0e5ed857934723c7c685d4d260d5e 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -976,7 +976,8 @@ static int s3c64xx_spi_setup(struct spi_device *spi) spi_set_ctldata(spi, NULL); err_gpio_req: - kfree(cs); + if (spi->dev.of_node) + kfree(cs); return err; }