On 2020/07/21 19:54, Maxim Levitsky wrote:
> Signed-off-by: Maxim Levitsky <mlevi...@redhat.com>
> ---
>  drivers/memstick/core/ms_block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/memstick/core/ms_block.c 
> b/drivers/memstick/core/ms_block.c
> index d9ee8e3dc72da..e4df03e10fb46 100644
> --- a/drivers/memstick/core/ms_block.c
> +++ b/drivers/memstick/core/ms_block.c
> @@ -1727,7 +1727,7 @@ static int msb_init_card(struct memstick_dev *card)
>       msb->pages_in_block = boot_block->attr.block_size * 2;
>       msb->block_size = msb->page_size * msb->pages_in_block;
>  
> -     if (msb->page_size > PAGE_SIZE) {
> +     if (!(blk_is_valid_logical_block_size(msb->page_size))) {
>               /* this isn't supported by linux at all, anyway*/
>               dbg("device page %d size isn't supported", msb->page_size);
>               return -EINVAL;
> 

Looks good to me.

Reviewed-by: Damien Le Moal <damien.lem...@wdc.com>

-- 
Damien Le Moal
Western Digital Research

Reply via email to