Skip to content

Commit

Permalink
Fixed issue waking up disk hibernation
Browse files Browse the repository at this point in the history
occur
Expected to copy HDIO_DRIVE_CMD header of 4 bytes from          (null) - it failed
  • Loading branch information
PeterSuh-Q3 committed Mar 16, 2024
1 parent 5ca3b40 commit ccbdcf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shim/storage/smart_shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,10 @@ static int handle_hdio_drive_cmd_ioctl(struct block_device *bdev, fmode_t mode,
//Before we execute ioctl we need to save the original header as ioctl will override it (they share buffer)
u8 req_header[HDIO_DRIVE_CMD_HDR_OFFSET];
if(unlikely(copy_from_user(req_header, buff_ptr, HDIO_DRIVE_CMD_HDR_OFFSET) != 0)) {
pr_loc_err("Expected to copy HDIO_DRIVE_CMD header of %d bytes from %p - it failed", HDIO_DRIVE_CMD_HDR_OFFSET,
buff_ptr);
if (buff_ptr != NULL) {
pr_loc_err("Expected to copy HDIO_DRIVE_CMD header of %d bytes from %p - it failed", HDIO_DRIVE_CMD_HDR_OFFSET,
buff_ptr);
}
return -EIO;
}

Expand Down

0 comments on commit ccbdcf9

Please sign in to comment.