summaryrefslogtreecommitdiff
path: root/drivers/pps
diff options
context:
space:
mode:
authorRaag Jadav <raag.jadav@intel.com>2025-03-18 14:40:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-15 19:22:32 +0300
commitbcfb443557166287ba544be308ed44d788599afa (patch)
tree7cae261f1e031ad017965bfa3afd8fa20310e6bb /drivers/pps
parent7c7f1bfdb2249f854a736d9b79778c7e5a29a150 (diff)
downloadlinux-bcfb443557166287ba544be308ed44d788599afa.tar.xz
pps: generators: tio: fix platform_set_drvdata()
platform_set_drvdata() is setting a double pointer to struct pps_tio as driver_data, which will point to the local stack of probe function instead of intended data. Set driver_data correctly and fix illegal memory access by its user. BUG: unable to handle page fault for address: ffffc9000117b738 RIP: 0010:hrtimer_active+0x2b/0x60 Call Trace: ? hrtimer_active+0x2b/0x60 hrtimer_cancel+0x19/0x50 pps_gen_tio_remove+0x1e/0x80 [pps_gen_tio] Fixes: c89755d1111f ("pps: generators: Add PPS Generator TIO Driver") Signed-off-by: Raag Jadav <raag.jadav@intel.com> Acked-by: Rodolfo Giometti <giometti@enneenne.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250318114038.2058677-1-raag.jadav@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pps')
-rw-r--r--drivers/pps/generators/pps_gen_tio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
index 1d5ffe055463..de00a85bfafa 100644
--- a/drivers/pps/generators/pps_gen_tio.c
+++ b/drivers/pps/generators/pps_gen_tio.c
@@ -230,7 +230,7 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
hrtimer_setup(&tio->timer, hrtimer_callback, CLOCK_REALTIME,
HRTIMER_MODE_ABS);
spin_lock_init(&tio->lock);
- platform_set_drvdata(pdev, &tio);
+ platform_set_drvdata(pdev, tio);
return 0;
}