mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-05 04:46:54 -04:00
gpib: cec: Unify *allocate_private usage
Use the return value of cec_allocate_private in calling code as early return value in case of error. Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com> Link: https://patch.msgid.link/20260116174647.317256-8-dominik.karol.piatkowski@protonmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b47077a4c0
commit
908206d82e
@@ -238,11 +238,13 @@ static int cec_generic_attach(struct gpib_board *board)
|
||||
{
|
||||
struct cec_priv *cec_priv;
|
||||
struct nec7210_priv *nec_priv;
|
||||
int retval;
|
||||
|
||||
board->status = 0;
|
||||
|
||||
if (cec_allocate_private(board))
|
||||
return -ENOMEM;
|
||||
retval = cec_allocate_private(board);
|
||||
if (retval)
|
||||
return retval;
|
||||
cec_priv = board->private_data;
|
||||
nec_priv = &cec_priv->nec7210_priv;
|
||||
nec_priv->read_byte = nec7210_ioport_read_byte;
|
||||
|
||||
Reference in New Issue
Block a user