Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: fix format string in debug prints

buf_idx type was changed to size_t, and few places
missed out to change the print format from %ld to %zu.
Use also uz for buf.size which is also of size_t

Fixes:
commit 56988f22e097 ("mei: fix possible integer overflow issue")'

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
35bf7692 941943cf

+6 -6
+1 -1
drivers/misc/mei/amthif.c
··· 160 160 * remove message from deletion list 161 161 */ 162 162 163 - dev_dbg(dev->dev, "amthif cb->buf.size - %zd cb->buf_idx - %zd\n", 163 + dev_dbg(dev->dev, "amthif cb->buf.size - %zu cb->buf_idx - %zu\n", 164 164 cb->buf.size, cb->buf_idx); 165 165 166 166 /* length is being truncated to PAGE_SIZE, however,
+1 -1
drivers/misc/mei/client.c
··· 1583 1583 return 0; 1584 1584 } 1585 1585 1586 - cl_dbg(dev, cl, "buf: size = %zd idx = %zd\n", 1586 + cl_dbg(dev, cl, "buf: size = %zu idx = %zu\n", 1587 1587 cb->buf.size, cb->buf_idx); 1588 1588 1589 1589 rets = mei_write_message(dev, &mei_hdr, buf->data + cb->buf_idx);
+3 -3
drivers/misc/mei/interrupt.c
··· 128 128 buf_sz = mei_hdr->length + cb->buf_idx; 129 129 /* catch for integer overflow */ 130 130 if (buf_sz < cb->buf_idx) { 131 - cl_err(dev, cl, "message is too big len %d idx %ld\n", 131 + cl_err(dev, cl, "message is too big len %d idx %zu\n", 132 132 mei_hdr->length, cb->buf_idx); 133 133 134 134 list_move_tail(&cb->list, &complete_list->list); ··· 137 137 } 138 138 139 139 if (cb->buf.size < buf_sz) { 140 - cl_dbg(dev, cl, "message overflow. size %zd len %d idx %zd\n", 140 + cl_dbg(dev, cl, "message overflow. size %zu len %d idx %zu\n", 141 141 cb->buf.size, mei_hdr->length, cb->buf_idx); 142 142 buffer = krealloc(cb->buf.data, buf_sz, GFP_KERNEL); 143 143 ··· 156 156 cb->buf_idx += mei_hdr->length; 157 157 158 158 if (mei_hdr->msg_complete) { 159 - cl_dbg(dev, cl, "completed read length = %lu\n", cb->buf_idx); 159 + cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); 160 160 list_move_tail(&cb->list, &complete_list->list); 161 161 } else { 162 162 pm_runtime_mark_last_busy(dev->dev);
+1 -1
drivers/misc/mei/main.c
··· 221 221 goto free; 222 222 } 223 223 224 - cl_dbg(dev, cl, "buf.size = %zd buf.idx = %zd offset = %lld\n", 224 + cl_dbg(dev, cl, "buf.size = %zu buf.idx = %zu offset = %lld\n", 225 225 cb->buf.size, cb->buf_idx, *offset); 226 226 if (*offset >= cb->buf_idx) { 227 227 rets = 0;