summaryrefslogtreecommitdiffstats
path: root/drivers/media/spi/cxd2880-spi.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-16media: cxd2880-spi: fix two memory leaks of dvb_spiColin Ian King1-3/+5
There are two return paths that do not kfree dvb_spi. Fix the memory leaks by returning via the exit label fail_adapter that will free dvi_spi. Detected by CoverityScan, CID#1475991 ("Resource Leak") Fixes: cb496cd472af ("media: cxd2880-spi: Add optional vcc regulator") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>? Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: cxd2880-spi: Add optional vcc regulatorNeil Armstrong1-0/+16
This patchset adds an optional VCC regulator to the driver probe function to make sure power is enabled to the module before starting attaching to the device. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: cxd2880-spi: fix probe when dvb_attach failsNeil Armstrong1-0/+1
When dvb_attach fails, probe returns 0, and remove crashes afterwards. This patch sets the return value to -ENODEV when attach fails. Fixes: bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-05media: cxd2880-spi: Modified how to declare structureYasunari Takiguchi1-5/+3
This is the modification of structure declaration for spi_transfer. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: cxd2880-spi: avoid out-of-bounds access warningArnd Bergmann1-17/+7
The -Warray-bounds warning in gcc-8 triggers for a newly added file: drivers/media/spi/cxd2880-spi.c: In function 'cxd2880_write_reg': drivers/media/spi/cxd2880-spi.c:111:3: error: 'memcpy' forming offset [133, 258] is out of the bounds [0, 132] of object 'send_data' with type 'u8[132]' {aka 'unsigned char[132]'} [-Werror=array-bounds] The problem appears to be that we have two range checks in this function, first comparing against BURST_WRITE_MAX (128) and then comparing against a literal '255'. The logic checking the buffer size looks at the second one and decides that this might be the actual maximum data length. This is understandable behavior from the compiler, but the code is actually safe. Since the first check is already shorter, we can remove the loop and only leave that. To be on the safe side in case BURST_WRITE_MAX might be increased, I'm leaving the check against U8_MAX. Fixes: bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface") Cc: Martin Sebor <msebor@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-03-07media: cxd2880: Fix location of DVB headersMauro Carvalho Chehab1-3/+3
Fix a trivial conflict, where the location of DVB headers got moved. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-07media: cxd2880-spi: Add support for CXD2880 SPI interfaceYasunari Takiguchi1-0/+670
This is the SPI adapter part of the driver for the Sony CXD2880 DVB-T2/T tuner + demodulator. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>