spi: fsl-dspi: Remove possible memory leak of 'chip'
authorBhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Sat, 31 Jan 2015 16:33:25 +0000 (22:03 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 2 Feb 2015 20:05:19 +0000 (20:05 +0000)
commitceadfd8de067e37d52e2af6bb60016cb90342fe8
tree1b3a76f797f5425f1ad42eb23f2791f5e785a22f
parent9298bc727385cd625cdda5e877bd3cba8acff668
spi: fsl-dspi: Remove possible memory leak of 'chip'

Move the check for spi->bits_per_word
before allocation, to avoid memory leak.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c