Skip to content

Commit d72f78d

Browse files
321lipengdavem330
authored andcommitted
net: pc300too: move out assignment in if condition
Should not use assignment in if condition. Signed-off-by: Peng Li <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f8864e2 commit d72f78d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/wan/pc300too.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,14 @@ static int pc300_pci_init_one(struct pci_dev *pdev,
349349
else
350350
card->n_ports = 2;
351351

352-
for (i = 0; i < card->n_ports; i++)
353-
if (!(card->ports[i].netdev = alloc_hdlcdev(&card->ports[i]))) {
352+
for (i = 0; i < card->n_ports; i++) {
353+
card->ports[i].netdev = alloc_hdlcdev(&card->ports[i]);
354+
if (!card->ports[i].netdev) {
354355
pr_err("unable to allocate memory\n");
355356
pc300_pci_remove_one(pdev);
356357
return -ENOMEM;
357358
}
359+
}
358360

359361
/* Reset PLX */
360362
p = &card->plxbase->init_ctrl;

0 commit comments

Comments
 (0)