lkml.org 
[lkml]   [2021]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets
From
Date
On Sun, 2021-01-03 at 17:26 +0100, Arnd Bergmann wrote:
[...]
> @@ -8209,7 +8208,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance
> *instance,
> if (instance->consistent_mask_64bit)
> put_unaligned_le64(sense_handle, sense_ptr);
> else
> - put_unaligned_le32(sense_handle, sense_ptr);
> + put_unaligned_le64(sense_handle, sense_ptr);
> }

This hunk can't be right. It effectively means removing the if.
However, the if is needed because sense_handle is a dma_addr_t which
can be either 32 or 64 bit. What about changing the if to

if (sizeof(dma_addr_t) == 8)

instead?

James


\
 
 \ /
  Last update: 2021-01-03 18:03    [W:0.055 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site