nvme, mmc: Fix SMAP violations in B_GET_MEDIA_STATUS.

Fixes #18736.
This commit is contained in:
Augustin Cavalier
2024-01-06 12:07:25 -05:00
parent 3433ec7334
commit 12bba3817d
2 changed files with 3 additions and 7 deletions
@@ -573,9 +573,8 @@ mmc_block_ioctl(void* cookie, uint32 op, void* buffer, size_t length)
if (buffer == NULL || length < sizeof(status_t))
return B_BAD_VALUE;
*(status_t *)buffer = B_OK;
return B_OK;
break;
status_t status = B_OK;
return user_memcpy(buffer, &status, sizeof(status_t));
}
case B_GET_DEVICE_SIZE:
@@ -937,10 +937,7 @@ nvme_disk_ioctl(void* cookie, uint32 op, void* buffer, size_t length)
switch (op) {
case B_GET_MEDIA_STATUS:
{
*(status_t *)buffer = info->media_status;
info->media_status = B_OK;
return B_OK;
break;
return user_memcpy(buffer, &info->media_status, sizeof(status_t));
}
case B_GET_DEVICE_SIZE: