mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
iscsi: Check for copyout errors in iscsi_ioctl_daemon_receive()
Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43148 (cherry picked from commit 74e713804fa4767991c5f20e6b85da4235107122)
This commit is contained in:
parent
7bc713a5a5
commit
9b28f3f032
1 changed files with 4 additions and 4 deletions
|
|
@ -1897,17 +1897,17 @@ iscsi_ioctl_daemon_receive(struct iscsi_softc *sc,
|
|||
return (EMSGSIZE);
|
||||
}
|
||||
|
||||
copyout(ip->ip_bhs, idr->idr_bhs, sizeof(*ip->ip_bhs));
|
||||
if (ip->ip_data_len > 0) {
|
||||
error = copyout(ip->ip_bhs, idr->idr_bhs, sizeof(*ip->ip_bhs));
|
||||
if (error == 0 && ip->ip_data_len > 0) {
|
||||
data = malloc(ip->ip_data_len, M_ISCSI, M_WAITOK);
|
||||
icl_pdu_get_data(ip, 0, data, ip->ip_data_len);
|
||||
copyout(data, idr->idr_data_segment, ip->ip_data_len);
|
||||
error = copyout(data, idr->idr_data_segment, ip->ip_data_len);
|
||||
free(data, M_ISCSI);
|
||||
}
|
||||
|
||||
icl_pdu_free(ip);
|
||||
|
||||
return (0);
|
||||
return (error);
|
||||
}
|
||||
#endif /* ICL_KERNEL_PROXY */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue