Skip to content

Commit

Permalink
[media] staging: Replaced BUG_ON with warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shilpa P authored and Mauro Carvalho Chehab committed Mar 3, 2017
1 parent eb3f1b7 commit 50ad58f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/staging/media/bcm2048/radio-bcm2048.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit 50ad58f

Please sign in to comment.