Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1535342 > unrolled thread
| Started by | Shilpa Puttegowda <shilpapri@gmail.com> |
|---|---|
| First post | 2016-12-03 08:10 +0100 |
| Last post | 2016-12-03 08:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] staging: Replaced BUG_ON with warnings Shilpa Puttegowda <shilpapri@gmail.com> - 2016-12-03 08:10 +0100
Re: [PATCH] staging: Replaced BUG_ON with warnings Allen <allen.lkml@gmail.com> - 2016-12-03 08:10 +0100
| From | Shilpa Puttegowda <shilpapri@gmail.com> |
|---|---|
| Date | 2016-12-03 08:10 +0100 |
| Subject | [PATCH] staging: Replaced BUG_ON with warnings |
| Message-ID | <sKcCl-6sU-1@gated-at.bofh.it> |
From: Shilpa P <shilpapri@gmail.com>
Don't crash the Kernel for driver errors
Signed-off-by: Shilpa P <shilpapri@gmail.com>
---
drivers/staging/media/bcm2048/radio-bcm2048.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 4d9bd02..05f5918 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -1538,7 +1538,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) {
@@ -1561,7 +1565,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)
--
1.9.1
[toc] | [next] | [standalone]
| From | Allen <allen.lkml@gmail.com> |
|---|---|
| Date | 2016-12-03 08:10 +0100 |
| Message-ID | <sKcCl-6sU-5@gated-at.bofh.it> |
| In reply to | #1535342 |
On Sat, Dec 3, 2016 at 12:32 PM, Shilpa Puttegowda <shilpapri@gmail.com> wrote: > From: Shilpa P <shilpapri@gmail.com> > > Don't crash the Kernel for driver errors > > Signed-off-by: Shilpa P <shilpapri@gmail.com> > --- > drivers/staging/media/bcm2048/radio-bcm2048.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > Acked-by: Allen Pais <allen.lkml@gmail.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web