[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1455725202-3567-1-git-send-email-tomas.winkler@intel.com>
Date: Wed, 17 Feb 2016 18:06:42 +0200
From: Tomas Winkler <tomas.winkler@...el.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Alexander Usyskin <alexander.usyskin@...el.com>,
linux-kernel@...r.kernel.org, Joe Perches <joe@...ches.com>,
Tomas Winkler <tomas.winkler@...el.com>
Subject: [char-misc-next V2] mei: fix format string in debug prints
From: Alexander Usyskin <alexander.usyskin@...el.com>
buf_idx type was changed to size_t, and few places
missed out to change the print format from %ld to %zu.
Fixes:
commit 56988f22e097 ("mei: fix possible integer overflow issue")'
Cc: Joe Perches <joe@...ches.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@...el.com>
Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
---
V2: use %ud for size_t instead of %zd
drivers/misc/mei/amthif.c | 2 +-
drivers/misc/mei/interrupt.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 04525ada9eda..5cbc7ea360ed 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -160,7 +160,7 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
* remove message from deletion list
*/
- dev_dbg(dev->dev, "amthif cb->buf.size - %zd cb->buf_idx - %zd\n",
+ dev_dbg(dev->dev, "amthif cb->buf.size - %zd cb->buf_idx - %zu\n",
cb->buf.size, cb->buf_idx);
/* length is being truncated to PAGE_SIZE, however,
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 06b744a503a3..6fae2a893b49 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -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 %zu\n",
mei_hdr->length, cb->buf_idx);
list_move_tail(&cb->list, &complete_list->list);
@@ -137,7 +137,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl,
}
if (cb->buf.size < buf_sz) {
- cl_dbg(dev, cl, "message overflow. size %zd len %d idx %zd\n",
+ cl_dbg(dev, cl, "message overflow. size %zd len %d idx %zu\n",
cb->buf.size, mei_hdr->length, cb->buf_idx);
buffer = krealloc(cb->buf.data, buf_sz, GFP_KERNEL);
@@ -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 = %zu\n", cb->buf_idx);
list_move_tail(&cb->list, &complete_list->list);
} else {
pm_runtime_mark_last_busy(dev->dev);
--
2.4.3
Powered by blists - more mailing lists