summaryrefslogtreecommitdiff
path: root/drivers/staging/media/bcm2048
diff options
context:
space:
mode:
authorShilpa P <shilpapri@gmail.com>2016-12-03 05:02:01 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-03-03 07:10:49 -0300
commit50ad58f9dc11ebdf7d66253dd1f4cd3f6642749d (patch)
tree01dbb109b44b22dc6d054dc411c8255e1c5ae645 /drivers/staging/media/bcm2048
parenteb3f1b7f2d09ffcc9638b03c4e7e69354e2d3cbb (diff)
[media] staging: Replaced BUG_ON with warnings
Don't crash the Kernel for driver errors Signed-off-by: Shilpa P <shilpapri@gmail.com> Acked-by: Allen Pais <allen.lkml@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/media/bcm2048')
-rw-r--r--drivers/staging/media/bcm2048/radio-bcm2048.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 37bd439ee08b..5696982d6955 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -1534,7 +1534,11 @@ static int bcm2048_parse_rt_match_c(struct bcm2048_device *bdev, int i,
if (crc == BCM2048_RDS_CRC_UNRECOVARABLE)
return 0;
- BUG_ON((index+2) >= BCM2048_MAX_RDS_RT);
+ if ((index + 2) >= BCM2048_MAX_RDS_RT) {
+ dev_err(&bdev->client->dev,
+ "Incorrect index = %d\n", index);
+ return 0;
+ }
if ((bdev->rds_info.radio_text[i] & BCM2048_RDS_BLOCK_MASK) ==
BCM2048_RDS_BLOCK_C) {
@@ -1557,7 +1561,11 @@ static void bcm2048_parse_rt_match_d(struct bcm2048_device *bdev, int i,
if (crc == BCM2048_RDS_CRC_UNRECOVARABLE)
return;
- BUG_ON((index+4) >= BCM2048_MAX_RDS_RT);
+ if ((index + 4) >= BCM2048_MAX_RDS_RT) {
+ dev_err(&bdev->client->dev,
+ "Incorrect index = %d\n", index);
+ return;
+ }
if ((bdev->rds_info.radio_text[i] & BCM2048_RDS_BLOCK_MASK) ==
BCM2048_RDS_BLOCK_D)