]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
liveupdate: fix return value on session allocation failure
authorPasha Tatashin <pasha.tatashin@soleen.com>
Wed, 15 Apr 2026 19:37:38 +0000 (19:37 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 27 Apr 2026 12:54:23 +0000 (05:54 -0700)
commit0562b572ce591858749fc2f9477567e7e5c5d99f
treefdc047a55a38f58e2e00a5bcde3a33550dca0f51
parent602655067e25030cb68c32a355ba1007a76a0c5a
liveupdate: fix return value on session allocation failure

When session allocation fails during deserialization, the global 'err'
variable was not updated before returning.  This caused subsequent calls
to luo_session_deserialize() to incorrectly report success.

Ensure 'err' is set to the error code from PTR_ERR(session).  This ensures
that an error is correctly returned to userspace when it attempts to open
/dev/liveupdate in the new kernel if deserialization failed.

Link: https://lore.kernel.org/20260415193738.515491-1-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Cc: David Matlack <dmatlack@google.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Samiullah Khawaja <skhawaja@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/liveupdate/luo_session.c