All of
 help / color / mirror / Atom feed
From: Axel Lin <>
To: Mark Brown <>
Cc: Baruch Siach <>,
	Jarkko Nikula
Subject: [PATCH v2] spi: dw: Don't call kfree for memory allocated by devm_kzalloc
Date: Tue, 25 Mar 2014 12:44:13 +0800	[thread overview]
Message-ID: <1395722653.16744.1.camel@phoenix> (raw)

With devm_kzalloc, the memory is automatically freed when spi_device detach from
the bus.

Fixes: commit 43f627ac9de42 (spi: dw: fix memory leak on error path)
Signed-off-by: Axel Lin <>
Acked-by: Baruch Siach <>
v2: Correct Fixes tag and also add Baruch's Ack.
 drivers/spi/spi-dw.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 8b7e4a3..712ac562 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -664,12 +664,6 @@ static int dw_spi_setup(struct spi_device *spi)
 	return 0;
-static void dw_spi_cleanup(struct spi_device *spi)
-	struct chip_data *chip = spi_get_ctldata(spi);
-	kfree(chip);
 static int init_queue(struct dw_spi *dws)
@@ -799,7 +793,6 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
 	master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
 	master->bus_num = dws->bus_num;
 	master->num_chipselect = dws->num_cs;
-	master->cleanup = dw_spi_cleanup;
 	master->setup = dw_spi_setup;
 	master->transfer = dw_spi_transfer;
 	master->max_speed_hz = dws->max_freq;

To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to
More majordomo info at

             reply	other threads:[~2014-03-25  4:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  4:44 Axel Lin [this message]
2014-03-28 11:48 ` [PATCH v2] spi: dw: Don't call kfree for memory allocated by devm_kzalloc Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395722653.16744.1.camel@phoenix \ \ \ \
    --cc=jarkko.nikula-VuQAYsv1563Yd54FQh9/ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.