“433fcf6b7b31f1f233dd50aeb9d066a0f6ed4b9d”上不存在“drivers/pci/controller/pci-hyperv.c”
提交 d5641c64 编写于 作者: C Chengguang Xu 提交者: Rafael J. Wysocki

PM / hibernate: cast PAGE_SIZE to int when comparing with error code

If PAGE_SIZE is unsigned type then negative error code will be
larger than PAGE_SIZE.
Signed-off-by: NChengguang Xu <cgxu519@gmx.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 021c9179
...@@ -923,7 +923,7 @@ int swsusp_write(unsigned int flags) ...@@ -923,7 +923,7 @@ int swsusp_write(unsigned int flags)
} }
memset(&snapshot, 0, sizeof(struct snapshot_handle)); memset(&snapshot, 0, sizeof(struct snapshot_handle));
error = snapshot_read_next(&snapshot); error = snapshot_read_next(&snapshot);
if (error < PAGE_SIZE) { if (error < (int)PAGE_SIZE) {
if (error >= 0) if (error >= 0)
error = -EFAULT; error = -EFAULT;
...@@ -1483,7 +1483,7 @@ int swsusp_read(unsigned int *flags_p) ...@@ -1483,7 +1483,7 @@ int swsusp_read(unsigned int *flags_p)
memset(&snapshot, 0, sizeof(struct snapshot_handle)); memset(&snapshot, 0, sizeof(struct snapshot_handle));
error = snapshot_write_next(&snapshot); error = snapshot_write_next(&snapshot);
if (error < PAGE_SIZE) if (error < (int)PAGE_SIZE)
return error < 0 ? error : -EFAULT; return error < 0 ? error : -EFAULT;
header = (struct swsusp_info *)data_of(snapshot); header = (struct swsusp_info *)data_of(snapshot);
error = get_swap_reader(&handle, flags_p); error = get_swap_reader(&handle, flags_p);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册