staging: kpc2000_spi: eliminated duplicate initialization of master local variable.
authorJeremy Sowden <jeremy@azazel.net>
Sat, 27 Apr 2019 19:54:01 +0000 (20:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Apr 2019 12:19:03 +0000 (14:19 +0200)
master was being initialized to a particular value and then having the
same value assigned to it immediately afterwards.  Removed the
initializer.

Since the value assigned to master was dynamically allocated, this fixes
a memory-leak.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc_spi/spi_driver.c

index e77f04bf02d9628f73d6b1e8144313c10baa6cc7..c0999e0805773e697436b956662c3ea69bc6653f 100644 (file)
@@ -408,7 +408,7 @@ static int
 kp_spi_probe(struct platform_device *pldev)
 {
     struct kpc_core_device_platdata *drvdata;
-    struct spi_master *master = spi_alloc_master(&pldev->dev, sizeof(struct kp_spi));
+    struct spi_master *master;
     struct kp_spi *kpspi;
     struct resource *r;
     int status = 0;