drivers: staging: iio: adc: fix uninitialized use
Subsystems (3)
PATCH 1/1 drivers: staging: iio: adc: fix uninitialized use
Fixed an uninitialized variable access. In the first two error paths in max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.
The intended value for st->reg *is* available at that point in 'reg', so just use that directly.
--- drivers/staging/iio/adc/max1363_core.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/iio/adc/max1363_core.c +4 -4
@@ -1335,11 +1335,11 @@ error_free_device:else iio_device_unregister (indio_dev); error_disable_reg: -if (!IS_ERR (st->reg)) -regulator_disable (st->reg); +if (!IS_ERR (reg)) +regulator_disable (reg); error_put_reg: -if (!IS_ERR (st->reg)) -regulator_put (st->reg); +if (!IS_ERR (reg)) +regulator_put (reg);return ret; }
Signature · 1 line
1.7.4.1
Quoted 3 lines · Chris Forbes
Fixed an uninitialized variable access. In the first two error paths in
max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.
Good spot. Please tech TODO files for staging patches. In this case it would have given you the mailing list, now cc'd.
Quoted 5 lines
The intended value for
st->reg*is* available at that point in 'reg', so just use that directly.Signed-off-by Chris Forbes <[email protected]>
Quoted 24 lines
--- drivers/staging/iio/adc/max1363_core.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)drivers/staging/iio/adc/max1363_core.c +4
-4@@ -1335,11 +1335,11 @@ error_free_device:else iio_device_unregister (indio_dev); error_disable_reg: -if (!IS_ERR (st->reg)) -regulator_disable (st->reg); +if (!IS_ERR (reg)) +regulator_disable (reg); error_put_reg: -if (!IS_ERR (st->reg)) -regulator_put (st->reg); +if (!IS_ERR (reg)) +regulator_put (reg);return ret; }
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · Chris Forbes
Fixed an uninitialized variable access. In the first two error paths in
max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.Good spot. Please tech TODO files for staging patches. In this case it would have given you the mailing list, now cc'd.
It would better to add an entry to MAINTAINERS so that ./scripts/get_maintainer.pl gave the right lists.
regards,
dan carpenter
Quoted 10 lines · Dan Carpenter
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · Chris Forbes
Fixed an uninitialized variable access. In the first two error paths in
max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.Good spot. Please tech TODO files for staging patches. In this case it would have given you the mailing list, now cc'd.
It would better to add an entry to
MAINTAINERSso that./scripts/get_maintainer.plgave the right lists.
Perhaps, but Greg KH is anti, so it isn't going to happen.
Quoted 6 lines · Jonathan Cameron
Quoted 5 lines · Dan Carpenter
Quoted 4 lines · Jonathan Cameron
Quoted 3 lines · Chris Forbes
Fixed an uninitialized variable access. In the first two error paths in
max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Good spot. Please tech TODO files for staging patches. In this case it would have given you the mailing list, now cc'd.
It would better to add an entry to
MAINTAINERSso that./scripts/get_maintainer.plgave the right lists.Perhaps, but Greg KH is anti, so it isn't going to happen.
I'm coming around on this, for larger chunks of code, like iio, I don't mind it, so feel free to send me an entry.
thanks,
greg k-h
cover MAINTAINERS: Add staging
If you've changed your mind, here are the parts that apply from the original submission in June, 2010.
Added a removal of one deleted section as well.
Joe Perches (14):
MAINTAINERS: Add STAGING - ASUS OLED
MAINTAINERS: Add STAGING - COMEDI
MAINTAINERS: Add STAGING - CRYSTAL HD VIDEO DECODER
MAINTAINERS: Add STAGING - ECHO CANCELLER
MAINTAINERS: Add STAGING - FRONTIER TRANZPORT AND ALPHATRACK
MAINTAINERS: Add STAGING - HYPER-V (MICROSOFT)
MAINTAINERS: Add STAGING - INDUSTRIAL IO
MAINTAINERS: Add STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
MAINTAINERS: Add STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER
MAINTAINERS: Add STAGING - VIA VT665X DRIVERS
MAINTAINERS: Add STAGING - WINBOND IS89C35 WLAN USB DRIVER
MAINTAINERS: Add STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS
MAINTAINERS: Add STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER
MAINTAINERS: Remove se401 entry
MAINTAINERS | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 72 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.6.131.g99019
PATCH 1/14 MAINTAINERS: Add STAGING - ASUS OLED
--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6069,6 +6069,11 @@ L: [email protected] S: Maintained F: drivers/staging/ +STAGING - ASUS OLED +M: Jakub Schmidtke <[email protected]> +S: Odd Fixes +F: drivers/staging/asus_oled/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 2/14 MAINTAINERS: Add STAGING - COMEDI
In reply to Joe Perches--- MAINTAINERS | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
MAINTAINERS +6 -0
@@ -6074,6 +6074,12 @@ M: Jakub Schmidtke <[email protected]> S: Odd Fixes F: drivers/staging/asus_oled/ +STAGING - COMEDI +M: Ian Abbott <[email protected]> +M: Mori Hess <[email protected]> +S: Odd Fixes +F: drivers/staging/comedi/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 3/14 MAINTAINERS: Add STAGING - CRYSTAL HD VIDEO DECODER
In reply to Joe Perches--- MAINTAINERS | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
@@ -6080,6 +6080,14 @@ M: Mori Hess <[email protected]> S: Odd Fixes F: drivers/staging/comedi/ +STAGING - CRYSTAL HD VIDEO DECODER +M: Naren Sankar <[email protected]> +M: Jarod Wilson <[email protected]> +M: Scott Davilla <[email protected]> +M: Manu Abraham <[email protected]> +S: Odd Fixes +F: drivers/staging/crystalhd/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 4/14 MAINTAINERS: Add STAGING - ECHO CANCELLER
In reply to Joe Perches--- MAINTAINERS | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
MAINTAINERS +6 -0
@@ -6088,6 +6088,12 @@ M: Manu Abraham <[email protected]> S: Odd Fixes F: drivers/staging/crystalhd/ +STAGING - ECHO CANCELLER +M: Steve Underwood <[email protected]> +M: David Rowe <[email protected]> +S: Odd Fixes +F: drivers/staging/echo/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 5/14 MAINTAINERS: Add STAGING - FRONTIER TRANZPORT AND ALPHATRACK
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6094,6 +6094,11 @@ M: David Rowe <[email protected]> S: Odd Fixes F: drivers/staging/echo/ +STAGING - FRONTIER TRANZPORT AND ALPHATRACK +M: David Täht <[email protected]> +S: Odd Fixes +F: drivers/staging/frontier/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 6/14 MAINTAINERS: Add STAGING - HYPER-V (MICROSOFT)
In reply to Joe Perches--- MAINTAINERS | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
MAINTAINERS +6 -0
@@ -6099,6 +6099,12 @@ M: David Täht <[email protected]> S: Odd Fixes F: drivers/staging/frontier/ +STAGING - HYPER-V (MICROSOFT) +M: Hank Janssen <[email protected]> +M: Haiyang Zhang <[email protected]> +S: Odd Fixes +F: drivers/staging/hv/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 7/14 MAINTAINERS: Add STAGING - INDUSTRIAL IO
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6105,6 +6105,11 @@ M: Haiyang Zhang <[email protected]> S: Odd Fixes F: drivers/staging/hv/ +STAGING - INDUSTRIAL IO +M: Jonathan Cameron <[email protected]> +S: Odd Fixes +F: drivers/staging/iio/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 8/14 MAINTAINERS: Add STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6110,6 +6110,11 @@ M: Jonathan Cameron <[email protected]> S: Odd Fixes F: drivers/staging/iio/ +STAGING - PARALLEL LCD/KEYPAD PANEL DRIVER +M: Willy Tarreau <[email protected]> +S: Odd Fixes +F: drivers/staging/panel/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 9/14 MAINTAINERS: Add STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6115,6 +6115,11 @@ M: Willy Tarreau <[email protected]> S: Odd Fixes F: drivers/staging/panel/ +STAGING - SILICON MOTION SM7XX FRAME BUFFER DRIVER +M: Teddy Wang <[email protected]> +S: Odd Fixes +F: drivers/staging/sm7xx/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 10/14 MAINTAINERS: Add STAGING - VIA VT665X DRIVERS
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6120,6 +6120,11 @@ M: Teddy Wang <[email protected]> S: Odd Fixes F: drivers/staging/sm7xx/ +STAGING - VIA VT665X DRIVERS +M: Forest Bond <[email protected]> +S: Odd Fixes +F: drivers/staging/vt665?/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 11/14 MAINTAINERS: Add STAGING - WINBOND IS89C35 WLAN USB DRIVER
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6125,6 +6125,11 @@ M: Forest Bond <[email protected]> S: Odd Fixes F: drivers/staging/vt665?/ +STAGING - WINBOND IS89C35 WLAN USB DRIVER +M: Pavel Machek <[email protected]> +S: Odd Fixes +F: drivers/staging/winbond/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 12/14 MAINTAINERS: Add STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS
In reply to Joe Perches--- MAINTAINERS | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
MAINTAINERS +6 -0
@@ -6069,6 +6069,12 @@ L: [email protected] S: Maintained F: drivers/staging/ +STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS +M: Henk de Groot <[email protected]> +S: Odd Fixes +F: drivers/staging/wlags49_h2/ +F: drivers/staging/wlags49_h25/ + STAGING - ASUS OLED M: Jakub Schmidtke <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 13/14 MAINTAINERS: Add STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER
In reply to Joe Perches--- MAINTAINERS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
MAINTAINERS +5 -0
@@ -6136,6 +6136,11 @@ M: Pavel Machek <[email protected]> S: Odd Fixes F: drivers/staging/winbond/ +STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER +M: Arnaud Patard <[email protected]> +S: Odd Fixes +F: drivers/staging/xgifb/ + STARFIRE/DURALAN NETWORK DRIVER M: Ion Badulescu <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.6.131.g99019
PATCH 14/14 MAINTAINERS: Remove se401 entry
In reply to Joe PerchesCommit b287db119edb ("se401: remove last V4L1 driver") removed the files, remove the entry.
--- MAINTAINERS | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
MAINTAINERS +0 -7
@@ -6638,13 +6638,6 @@ W: http://pegasus2.sourceforge.net/ S: Maintained F: drivers/net/usb/rtl8150.c -USB SE401 DRIVER -L: [email protected] -W: http://www.chello.nl/~j.vreeken/se401/ -S: Orphan -F: Documentation/video4linux/se401.txt -F: drivers/staging/se401/ - USB SERIAL BELKIN F5U103 DRIVER M: William Greathouse <[email protected]> L: [email protected]
Signature · 1 line
1.7.6.131.g99019
Re: [PATCH 00/14] MAINTAINERS: Add staging
In reply to Joe PerchesQuoted 4 lines · Joe Perches
If you've changed your mind, here are the parts that apply from the original submission in June, 2010.
Added a removal of one deleted section as well.
Ah, what the hell, now applied...
Quoted 6 lines · Chris Forbes
Fixed an uninitialized variable access. In the first two error paths in
max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.The intended value for
st->reg*is* available at that point in 'reg', so just use that directly.
This doesn't apply anymore, care to redo it against the latest staging-next branch and resend?
thanks,
greg k-h
Looks one of Dan Carpenter's patches in the staging-next tree -- f88af7e -- already fixes this; disregard my patch.
-- Chris
Quoted 15 lines · Greg KH
Quoted 6 lines · Chris Forbes
Fixed an uninitialized variable access. In the first two error paths in
max1363_probe(), 'st' is not yet initialized, but its 'reg' member is accessed anyway. This would most likely crash.The intended value for
st->reg*is* available at that point in 'reg', so just use that directly.This doesn't apply anymore, care to redo it against the latest staging-next branch and resend?
thanks,
greg k-h
Quoted 2 lines · Chris Forbes
Looks one of Dan Carpenter's patches in the staging-next tree -- f88af7e -- already fixes this; disregard my patch.
Consider it disregarded.