mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-02 23:25:34 -04:00
gpib: pc2: Unify *allocate_private usage
Use the return value of 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-25-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
68de22e994
commit
c2a9f77c0e
@@ -256,10 +256,12 @@ static int pc2_generic_attach(struct gpib_board *board, const struct gpib_board_
|
||||
{
|
||||
struct pc2_priv *pc2_priv;
|
||||
struct nec7210_priv *nec_priv;
|
||||
int retval;
|
||||
|
||||
board->status = 0;
|
||||
if (allocate_private(board))
|
||||
return -ENOMEM;
|
||||
retval = allocate_private(board);
|
||||
if (retval)
|
||||
return retval;
|
||||
pc2_priv = board->private_data;
|
||||
nec_priv = &pc2_priv->nec7210_priv;
|
||||
nec_priv->read_byte = nec7210_ioport_read_byte;
|
||||
|
||||
Reference in New Issue
Block a user