Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 265aac26 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

fsi: Don't use device_unregister() in fsi_master_register()



In the error path of fsi_master_register(), we currently
use device_unregister(). This will cause the last reference
to the structure to be dropped, thus freeing the enclosing
structure, which isn't what the callers want.

Use device_del() instead so that we return to the caller
with a refcount of 1. The caller can then assume that it
must use put_device() after a call to fsi_master_register()
regardless of whether the latter suceeded or failed.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 55382d30
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment