return EFI_MEDIA_CHANGED;
if (!this->media->media_present)
return EFI_NO_MEDIA;
- /* media->io_align is a power of 2 */
- if ((uintptr_t)buffer & (this->media->io_align - 1))
+ /* media->io_align is a power of 2 or 0 */
+ if (this->media->io_align &&
+ (uintptr_t)buffer & (this->media->io_align - 1))
return EFI_INVALID_PARAMETER;
if (lba * this->media->block_size + buffer_size >
this->media->last_block * this->media->block_size)
return EFI_MEDIA_CHANGED;
if (!this->media->media_present)
return EFI_NO_MEDIA;
- /* media->io_align is a power of 2 */
- if ((uintptr_t)buffer & (this->media->io_align - 1))
+ /* media->io_align is a power of 2 or 0 */
+ if (this->media->io_align &&
+ (uintptr_t)buffer & (this->media->io_align - 1))
return EFI_INVALID_PARAMETER;
if (lba * this->media->block_size + buffer_size >
this->media->last_block * this->media->block_size)