Skip to content

Commit ab8c93f

Browse files
author
Fox Snowpatch
committed
1 parent 85ff933 commit ab8c93f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/powerpc/platforms/pseries/papr-hvpipe.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ static int hvpipe_rtas_recv_msg(char __user *buf, int size)
209209
ret = copy_to_user(buf,
210210
rtas_work_area_raw_buf(work_area),
211211
bytes_written);
212-
if (!ret)
212+
if (ret)
213+
ret = -EFAULT;
214+
else
213215
ret = bytes_written;
214216
}
215217
} else {
@@ -376,7 +378,7 @@ static ssize_t papr_hvpipe_handle_read(struct file *file,
376378

377379
ret = copy_to_user(buf, &hdr, HVPIPE_HDR_LEN);
378380
if (ret)
379-
return ret;
381+
return -EFAULT;
380382

381383
/*
382384
* Message event has payload, so get the payload with

0 commit comments

Comments
 (0)