Skip to content

Commit d274ac5

Browse files
kusumibehlendorf
authored andcommitted
Don't directly cast unsigned long to void*
Cast to uintptr_t first for portability on integer to/from pointer conversion. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com> Closes #9065
1 parent 1ff4682 commit d274ac5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

module/zfs/zfs_ioctl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7331,7 +7331,8 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
73317331

73327332
zc = kmem_zalloc(sizeof (zfs_cmd_t), KM_SLEEP);
73337333

7334-
error = ddi_copyin((void *)arg, zc, sizeof (zfs_cmd_t), flag);
7334+
error = ddi_copyin((void *)(uintptr_t)arg, zc, sizeof (zfs_cmd_t),
7335+
flag);
73357336
if (error != 0) {
73367337
error = SET_ERROR(EFAULT);
73377338
goto out;
@@ -7498,7 +7499,7 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
74987499

74997500
out:
75007501
nvlist_free(innvl);
7501-
rc = ddi_copyout(zc, (void *)arg, sizeof (zfs_cmd_t), flag);
7502+
rc = ddi_copyout(zc, (void *)(uintptr_t)arg, sizeof (zfs_cmd_t), flag);
75027503
if (error == 0 && rc != 0)
75037504
error = SET_ERROR(EFAULT);
75047505
if (error == 0 && vec->zvec_allow_log) {

0 commit comments

Comments
 (0)