hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/hw/hfi1/file_ops.c
....@@ -1359,12 +1359,15 @@
13591359 addr = arg + offsetof(struct hfi1_tid_info, tidcnt);
13601360 if (copy_to_user((void __user *)addr, &tinfo.tidcnt,
13611361 sizeof(tinfo.tidcnt)))
1362
- return -EFAULT;
1362
+ ret = -EFAULT;
13631363
13641364 addr = arg + offsetof(struct hfi1_tid_info, length);
1365
- if (copy_to_user((void __user *)addr, &tinfo.length,
1365
+ if (!ret && copy_to_user((void __user *)addr, &tinfo.length,
13661366 sizeof(tinfo.length)))
13671367 ret = -EFAULT;
1368
+
1369
+ if (ret)
1370
+ hfi1_user_exp_rcv_invalid(fd, &tinfo);
13681371 }
13691372
13701373 return ret;