aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/9p/protocol.c3
-rw-r--r--net/9p/trans_common.c2
-rw-r--r--net/9p/trans_virtio.c15
3 files changed, 14 insertions, 6 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 8a4084fa8b5a..a7e899740041 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -468,7 +468,8 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
468 case 'E':{ 468 case 'E':{
469 int32_t cnt = va_arg(ap, int32_t); 469 int32_t cnt = va_arg(ap, int32_t);
470 const char *k = va_arg(ap, const void *); 470 const char *k = va_arg(ap, const void *);
471 const char *u = va_arg(ap, const void *); 471 const char __user *u = va_arg(ap,
472 const void __user *);
472 errcode = p9pdu_writef(pdu, proto_version, "d", 473 errcode = p9pdu_writef(pdu, proto_version, "d",
473 cnt); 474 cnt);
474 if (!errcode && pdu_write_urw(pdu, k, u, cnt)) 475 if (!errcode && pdu_write_urw(pdu, k, u, cnt))
diff --git a/net/9p/trans_common.c b/net/9p/trans_common.c
index d47880e971dd..e883172f9aa2 100644
--- a/net/9p/trans_common.c
+++ b/net/9p/trans_common.c
@@ -66,7 +66,7 @@ p9_payload_gup(struct p9_req_t *req, size_t *pdata_off, int *pdata_len,
66 uint32_t pdata_mapped_pages; 66 uint32_t pdata_mapped_pages;
67 struct trans_rpage_info *rpinfo; 67 struct trans_rpage_info *rpinfo;
68 68
69 *pdata_off = (size_t)req->tc->pubuf & (PAGE_SIZE-1); 69 *pdata_off = (__force size_t)req->tc->pubuf & (PAGE_SIZE-1);
70 70
71 if (*pdata_off) 71 if (*pdata_off)
72 first_page_bytes = min(((size_t)PAGE_SIZE - *pdata_off), 72 first_page_bytes = min(((size_t)PAGE_SIZE - *pdata_off),
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index e8f046b07182..244e70742183 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -326,8 +326,11 @@ req_retry_pinned:
326 outp = pack_sg_list_p(chan->sg, out, VIRTQUEUE_NUM, 326 outp = pack_sg_list_p(chan->sg, out, VIRTQUEUE_NUM,
327 pdata_off, rpinfo->rp_data, pdata_len); 327 pdata_off, rpinfo->rp_data, pdata_len);
328 } else { 328 } else {
329 char *pbuf = req->tc->pubuf ? req->tc->pubuf : 329 char *pbuf;
330 req->tc->pkbuf; 330 if (req->tc->pubuf)
331 pbuf = (__force char *) req->tc->pubuf;
332 else
333 pbuf = req->tc->pkbuf;
331 outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf, 334 outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf,
332 req->tc->pbuf_size); 335 req->tc->pbuf_size);
333 } 336 }
@@ -352,8 +355,12 @@ req_retry_pinned:
352 in = pack_sg_list_p(chan->sg, out+inp, VIRTQUEUE_NUM, 355 in = pack_sg_list_p(chan->sg, out+inp, VIRTQUEUE_NUM,
353 pdata_off, rpinfo->rp_data, pdata_len); 356 pdata_off, rpinfo->rp_data, pdata_len);
354 } else { 357 } else {
355 char *pbuf = req->tc->pubuf ? req->tc->pubuf : 358 char *pbuf;
356 req->tc->pkbuf; 359 if (req->tc->pubuf)
360 pbuf = (__force char *) req->tc->pubuf;
361 else
362 pbuf = req->tc->pkbuf;
363
357 in = pack_sg_list(chan->sg, out+inp, VIRTQUEUE_NUM, 364 in = pack_sg_list(chan->sg, out+inp, VIRTQUEUE_NUM,
358 pbuf, req->tc->pbuf_size); 365 pbuf, req->tc->pbuf_size);
359 } 366 }