mei: fix format string in debug prints
Subsystems (2)
From: Alexander Usyskin <[email protected]>
buf_idx type was changed to size_t, and few places missed out to change the print format from %ld to %zd.
Fixes:
commit 56988f22e097 ("mei: fix possible integer overflow issue")'
--- drivers/misc/mei/interrupt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/mei/interrupt.c +2 -2
@@ -128,7 +128,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl, buf_sz = mei_hdr->length + cb->buf_idx;/* catch for integer overflow */ if (buf_sz < cb->buf_idx) { -cl_err (dev, cl,"message is too big len %d idx %ld\n" , +cl_err (dev, cl,"message is too big len %d idx %zd\n" , mei_hdr->length, cb->buf_idx);list_move_tail (&cb->list, &complete_list->list);
@@ -156,7 +156,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl, cb->buf_idx += mei_hdr->length;if (mei_hdr->msg_complete) { -cl_dbg (dev, cl,"completed read length = %lu\n" , cb->buf_idx); +cl_dbg (dev, cl,"completed read length = %zd\n" , cb->buf_idx);list_move_tail (&cb->list, &complete_list->list); }else {pm_runtime_mark_last_busy (dev->dev);
Signature · 1 line
2.4.3
On Wed, 2016-02-17 at 12:27 +0200, Tomas Winkler wrote:
[]
Quoted 2 lines
buf_idxtype was changed tosize_t, and few places missed out to change the print format from %ld to %zd.
trivia:
drivers/misc/mei/interrupt.c
Quoted 1 line
drivers/misc/mei/interrupt.c +0
-0
[]
drivers/misc/mei/interrupt.c int mei_cl_irq_read_msg(struct mei_cl *cl, · line 132
Quoted 7 lines
drivers/misc/mei/interrupt.c +1
-1@@ -128,7 +128,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl, buf_sz = mei_hdr->length + cb->buf_idx; /* catch for integer overflow */ if (buf_sz < cb->buf_idx) { -cl_err (dev, cl,"message is too big len %d idx %ld\n" , +cl_err (dev, cl,"message is too big len %d idx %zd\n" , mei_hdr->length, cb->buf_idx);
[etc...]
buf_idx is size_t and it should probably use %zu
ssize_t -> %zdsize_t -> %zu
Quoted 23 lines · Tomas Winkler
[]
Quoted 2 lines
buf_idxtype was changed tosize_t, and few places missed out to change the print format from %ld to %zd.trivia:
drivers/misc/mei/interrupt.c
Quoted 1 line
drivers/misc/mei/interrupt.c +0
-0[]
drivers/misc/mei/interrupt.c int mei_cl_irq_read_msg(struct mei_cl *cl, · line 132
Quoted 7 lines
drivers/misc/mei/interrupt.c +1
-1@@ -128,7 +128,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl, buf_sz = mei_hdr->length + cb->buf_idx; /* catch for integer overflow */ if (buf_sz < cb->buf_idx) { -cl_err (dev, cl,"message is too big len %d idx %ld\n" , +cl_err (dev, cl,"message is too big len %d idx %zd\n" , mei_hdr->length, cb->buf_idx);
buf_idxissize_tand it should probably use %zu
Quoted 2 lines
ssize_t-> %zdsize_t-> %zu
Thanks, will fix.
Tomas