Commit 50ad58f9 authored by Shilpa P's avatar Shilpa P Committed by Mauro Carvalho Chehab

[media] staging: Replaced BUG_ON with warnings

Don't crash the Kernel for driver errors
Signed-off-by: default avatarShilpa P <shilpapri@gmail.com>
Acked-by: default avatarAllen Pais <allen.lkml@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent eb3f1b7f
...@@ -1534,7 +1534,11 @@ static int bcm2048_parse_rt_match_c(struct bcm2048_device *bdev, int i, ...@@ -1534,7 +1534,11 @@ static int bcm2048_parse_rt_match_c(struct bcm2048_device *bdev, int i,
if (crc == BCM2048_RDS_CRC_UNRECOVARABLE) if (crc == BCM2048_RDS_CRC_UNRECOVARABLE)
return 0; 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) == if ((bdev->rds_info.radio_text[i] & BCM2048_RDS_BLOCK_MASK) ==
BCM2048_RDS_BLOCK_C) { BCM2048_RDS_BLOCK_C) {
...@@ -1557,7 +1561,11 @@ static void bcm2048_parse_rt_match_d(struct bcm2048_device *bdev, int i, ...@@ -1557,7 +1561,11 @@ static void bcm2048_parse_rt_match_d(struct bcm2048_device *bdev, int i,
if (crc == BCM2048_RDS_CRC_UNRECOVARABLE) if (crc == BCM2048_RDS_CRC_UNRECOVARABLE)
return; 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) == if ((bdev->rds_info.radio_text[i] & BCM2048_RDS_BLOCK_MASK) ==
BCM2048_RDS_BLOCK_D) BCM2048_RDS_BLOCK_D)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment