]> www.infradead.org Git - users/hch/misc.git/commit
net: ti: icss-iep: Fix possible NULL pointer dereference for perout request
authorMeghana Malladi <m-malladi@ti.com>
Tue, 15 Apr 2025 09:05:43 +0000 (14:35 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 17 Apr 2025 10:11:24 +0000 (12:11 +0200)
commit7349c9e9979333abfce42da5f9025598083b59c9
treef91306f59e893f7cf9376a2683f8629af925227f
parent8ed2fa661350f0b49edb765d18173b5c766c3686
net: ti: icss-iep: Fix possible NULL pointer dereference for perout request

The ICSS IEP driver tracks perout and pps enable state with flags.
Currently when disabling pps and perout signals during icss_iep_exit(),
results in NULL pointer dereference for perout.

To fix the null pointer dereference issue, the icss_iep_perout_enable_hw
function can be modified to directly clear the IEP CMP registers when
disabling PPS or PEROUT, without referencing the ptp_perout_request
structure, as its contents are irrelevant in this case.

Fixes: 9b115361248d ("net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/7b1c7c36-363a-4085-b26c-4f210bee1df6@stanley.mountain/
Signed-off-by: Meghana Malladi <m-malladi@ti.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250415090543.717991-4-m-malladi@ti.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/ti/icssg/icss_iep.c