Skip to content

Commit cb81619

Browse files
Kittipon Meesompopdavem330
authored andcommitted
s390/qeth: fix using of ref counter for rxip addresses
IP-address setting and removal are delayed when the device is not yet in state SOFTSETUP or UP. ref_counter has been implemented only for ip-address with type normal. In this patch ref_counter logic is also used for ip-address with type rxip to allow appropriate handling of multiple postponed rxip add and del calls. Signed-off-by: Kittipon Meesompop <[email protected]> Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ea4ae35 commit cb81619

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/s390/net/qeth_l3_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
247247
return -ENOENT;
248248

249249
addr->ref_counter--;
250-
if (addr->type == QETH_IP_TYPE_NORMAL && addr->ref_counter > 0)
250+
if (addr->ref_counter > 0 && (addr->type == QETH_IP_TYPE_NORMAL ||
251+
addr->type == QETH_IP_TYPE_RXIP))
251252
return rc;
252253
if (addr->in_progress)
253254
return -EINPROGRESS;
@@ -329,8 +330,9 @@ int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *tmp_addr)
329330
kfree(addr);
330331
}
331332
} else {
332-
if (addr->type == QETH_IP_TYPE_NORMAL)
333-
addr->ref_counter++;
333+
if (addr->type == QETH_IP_TYPE_NORMAL ||
334+
addr->type == QETH_IP_TYPE_RXIP)
335+
addr->ref_counter++;
334336
}
335337

336338
return rc;

0 commit comments

Comments
 (0)