The spi_master struct was dynamically allocated but never freed.
Memory allocation used the type instead of *identifier to determine
the size of the area to allocate.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
struct resource *r;
const unsigned int *prop;
- master = spi_alloc_master(&dev->dev, sizeof(struct xspips));
+ master = spi_alloc_master(&dev->dev, sizeof(*xspi));
if (master == NULL)
return -ENOMEM;
put_master:
platform_set_drvdata(dev, NULL);
spi_master_put(master);
+ kfree(master);
return ret;
}
spi_unregister_master(master);
spi_master_put(master);
+ kfree(master);
/* Prevent double remove */
platform_set_drvdata(dev, NULL);