> -----Original Message-----
> From: Paul Greenwalt <[email protected]>
> Sent: Friday, September 4, 2026 3:37 AM
> To: [email protected]
> Cc: Greenwalt, Paul <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; Loktionov, Aleksandr
> <[email protected]>
> Subject: [PATCH iwl-next v3 1/3] idpf: clear drvdata in idpf_decfg_device()
>
> pci_set_drvdata(pdev, adapter) is set as the last step of idpf_cfg_device(),
> but
> its inverse, idpf_decfg_device(), does not clear it. idpf_remove() open-codes
> the clear right after calling idpf_decfg_device(), so the two functions are
> not
> true opposites of each other.
>
> Move the pci_set_drvdata(pdev, NULL) into idpf_decfg_device() so the
> set/clear pairing lives in one place, and drop the now-redundant explicit
> clear
> from idpf_remove(). idpf_decfg_device() is also called from idpf_probe()'s
> err_init_wq unwind path, which did not previously clear drvdata at all; it now
> does too, closing that window for consistency with the rest of the teardown
> path. This has no observable effect: the driver core already clears drvdata
> via
> dev_set_drvdata() when a probe function returns an error, under
> device_lock(), before any consumer of drvdata can observe a stale pointer.
>
> Reviewed-by: Przemek Kitszel <[email protected]>
> Reviewed-by: Aleksandr Loktionov <[email protected]>
> Signed-off-by: Paul Greenwalt <[email protected]>
> ---
Tested-by: Samuel Salin <[email protected]>