Vaishnav Achath 73d5fe0462
spi: cadence-quadspi: Remove spi_master_put() in probe failure path
Currently the spi_master is allocated by devm_spi_alloc_master()
and devres core manages the deallocation, but in probe failure
path spi_master_put() is being handled manually which causes
"refcount underflow use-after-free" warning when probe failure happens
after allocating spi_master.

Trimmed backtrace during failure:

refcount_t: underflow; use-after-free.
pc : refcount_warn_saturate+0xf4/0x144
Call trace:
refcount_warn_saturate
kobject_put
put_device
devm_spi_release_controller
devres_release_all

This commit makes relevant changes to remove spi_master_put() from probe
failure path.

Fixes: 606e5d408184 ("spi: cadence-quadspi: Handle spi_unregister_master() in remove()")

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Link: https://lore.kernel.org/r/20220601071611.11853-1-vaishnav.a@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-14 13:26:35 +01:00
..
2022-01-04 14:59:40 +00:00
2022-01-07 13:36:37 +00:00
2021-07-20 13:34:05 +01:00
2021-12-23 13:38:38 +00:00
2021-12-23 13:38:39 +00:00
2022-05-26 14:43:28 +01:00
2022-05-25 16:55:16 -07:00
2022-04-20 14:25:20 +01:00
2022-03-08 20:07:09 +00:00
2021-08-26 12:09:38 +01:00
2022-03-15 12:03:58 +00:00
2022-06-03 11:48:47 -07:00
2022-04-19 13:13:48 +01:00