Skip to content

Commit 9eda38d

Browse files
Alexander Gordeevkuba-moo
authored andcommitted
net/af_iucv: fix virtual vs physical address confusion
Fix virtual vs physical address confusion. This does not fix a bug since virtual and physical address spaces are currently the same. Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Link: https://lore.kernel.org/r/20240215080500.2616848-1-agordeev@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fecc515 commit 9eda38d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

net/iucv/af_iucv.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,13 +1060,12 @@ static int iucv_sock_sendmsg(struct socket *sock, struct msghdr *msg,
10601060
int i;
10611061

10621062
/* skip iucv_array lying in the headroom */
1063-
iba[0].address = (u32)(addr_t)skb->data;
1063+
iba[0].address = (u32)virt_to_phys(skb->data);
10641064
iba[0].length = (u32)skb_headlen(skb);
10651065
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
10661066
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
10671067

1068-
iba[i + 1].address =
1069-
(u32)(addr_t)skb_frag_address(frag);
1068+
iba[i + 1].address = (u32)virt_to_phys(skb_frag_address(frag));
10701069
iba[i + 1].length = (u32)skb_frag_size(frag);
10711070
}
10721071
err = pr_iucv->message_send(iucv->path, &txmsg,
@@ -1162,13 +1161,12 @@ static void iucv_process_message(struct sock *sk, struct sk_buff *skb,
11621161
struct iucv_array *iba = (struct iucv_array *)skb->head;
11631162
int i;
11641163

1165-
iba[0].address = (u32)(addr_t)skb->data;
1164+
iba[0].address = (u32)virt_to_phys(skb->data);
11661165
iba[0].length = (u32)skb_headlen(skb);
11671166
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
11681167
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
11691168

1170-
iba[i + 1].address =
1171-
(u32)(addr_t)skb_frag_address(frag);
1169+
iba[i + 1].address = (u32)virt_to_phys(skb_frag_address(frag));
11721170
iba[i + 1].length = (u32)skb_frag_size(frag);
11731171
}
11741172
rc = pr_iucv->message_receive(path, msg,

0 commit comments

Comments
 (0)