pps: generators: tio: fix platform_set_drvdata()
PATCH 1/1 pps: generators: tio: fix platform_set_drvdata()
Set driver_data correctly and fix illegal memory access on driver reload.
--- drivers/pps/generators/pps_gen_tio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pps/generators/pps_gen_tio.c +1 -1
@@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)hrtimer_init (&tio->timer,CLOCK_REALTIME ,HRTIMER_MODE_ABS ); tio->timer.function = hrtimer_callback;spin_lock_init (&tio->lock); -platform_set_drvdata (pdev, &tio); +platform_set_drvdata (pdev, tio);return 0 ; }
base-commit: 6f119e3da79ce5e586340059403ab77201c1bb45
Signature · 1 line
2.34.1
Quoted 4 lines · Raag Jadav
Set
driver_datacorrectly and fix illegal memory access on driver reload.Fixes c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")Signed-off-by Raag Jadav <[email protected]>
Quoted 19 lines
--- drivers/pps/generators/pps_gen_tio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pps/generators/pps_gen_tio.c +1
-1@@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)hrtimer_init (&tio->timer,CLOCK_REALTIME ,HRTIMER_MODE_ABS ); tio->timer.function = hrtimer_callback;spin_lock_init (&tio->lock); -platform_set_drvdata (pdev, &tio); +platform_set_drvdata (pdev, tio);return 0 ; }base-commit:
6f119e3da79ce5e586340059403ab77201c1bb45
Signature · 4 lines
GNU/Linux Solutions e-mail: [email protected] Linux Device Driver [email protected] Embedded Systems phone: +39 349 2432127 UNIX programming
Quoted 1 line · Raag Jadav
Set
driver_datacorrectly and fix illegal memory access on driver reload.
Do you have it in practice or you are thinking it will be like this?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Quoted 1 line · Raag Jadav
Set
driver_datacorrectly and fix illegal memory access on driver reload.Do you have it in practice or you are thinking it will be like this?
I reproduced it but didn't want to bloat the commit message for an obvious fix.
Raag
Quoted 8 lines · Raag Jadav
Quoted 4 lines · Andy Shevchenko
Quoted 1 line · Raag Jadav
Set
driver_datacorrectly and fix illegal memory access on driver reload.Do you have it in practice or you are thinking it will be like this?
I reproduced it but didn't want to bloat the commit message for an obvious fix.
Then add a few (~3-5) lines of the traceback and update commit message to explain that this is a real case.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 13 lines · Raag Jadav
Set
driver_datacorrectly and fix illegal memory access on driver reload.Fixes c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")Signed-off-by Raag Jadav <[email protected]>--- drivers/pps/generators/pps_gen_tio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pps/generators/pps_gen_tio.c +0
-0
drivers/pps/generators/pps_gen_tio.c static int pps_gen_tio_probe(struct platform_device *pdev) · line 233
Quoted 5 lines
drivers/pps/generators/pps_gen_tio.c +1
-1@@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)hrtimer_init (&tio->timer,CLOCK_REALTIME ,HRTIMER_MODE_ABS ); tio->timer.function = hrtimer_callback;spin_lock_init (&tio->lock); -platform_set_drvdata (pdev, &tio); +platform_set_drvdata (pdev, tio);
What does reload have to do with this? Either the data pointer is set to the expected type or not, so that it can work properly, which has nothing to do with when the device is unbound and then rebound (which is what I think you mean by reload?)
So I think your changelog needs a lot of work here, as it's not really explaining what is happening properly.
thanks,
greg k-h
Quoted 9 lines · Greg KH
Quoted 8 lines · Raag Jadav
Set
driver_datacorrectly and fix illegal memory access on driver reload.Fixes c89755d1111f ("pps: generators: Add PPS Generator TIO Driver")Signed-off-by Raag Jadav <[email protected]>--- drivers/pps/generators/pps_gen_tio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
drivers/pps/generators/pps_gen_tio.c static int pps_gen_tio_probe(struct platform_device *pdev) · line 233
Quoted 10 lines
drivers/pps/generators/pps_gen_tio.c +1
-1@@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)hrtimer_init (&tio->timer,CLOCK_REALTIME ,HRTIMER_MODE_ABS ); tio->timer.function = hrtimer_callback;spin_lock_init (&tio->lock); -platform_set_drvdata (pdev, &tio); +platform_set_drvdata (pdev, tio);What does reload have to do with this? Either the data pointer is set to the expected type or not, so that it can work properly, which has nothing to do with when the device is unbound and then rebound (which is what I think you mean by reload?)
->remove() is the only user of driver_data here.
Quoted 2 lines
So I think your changelog needs a lot of work here, as it's not really explaining what is happening properly.
Sure, will update.
Raag