>  static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info *dev_info,
> -               u8 lun)
> +               u8 lun, u8 param_offset)
>  {
>         if (!dev_info || !dev_info->max_lu_supported) {
>                 pr_err("Max General LU supported by UFS isn't initialized\n");
>                 return false;
>         }
> -
> +       /* WB is not allowed in RPMB_WLUN */
/* wb is only allowed to either a sha*/
> +       if (param_offset == UNIT_DESC_PARAM_WB_BUF_ALLOC_UNITS)
> +               return lun < dev_info->max_lu_supported;
I think here you should use UFS_UPIU_MAX_WB_LUN_ID and not 
dev_info->max_lu_supported.

Thanks,
Avri

Reply via email to