Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755253AbcD0AmC (ORCPT ); Tue, 26 Apr 2016 20:42:02 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39658 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753525AbcDZXNb (ORCPT ); Tue, 26 Apr 2016 19:13:31 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Alexander Usyskin" , "Tomas Winkler" , "Greg Kroah-Hartman" Date: Wed, 27 Apr 2016 01:02:21 +0200 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 034/217] mei: fix format string in debug prints In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8426:ae4:c500:9cba:69ae:962d:6167 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3288 Lines: 89 3.16.35-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Usyskin commit 35bf7692e765c2275bf93fe573f7ca868ab73453 upstream. 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 Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/misc/mei/amthif.c | 2 +- drivers/misc/mei/client.c | 2 +- drivers/misc/mei/interrupt.c | 6 +++--- drivers/misc/mei/main.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c @@ -234,7 +234,7 @@ int mei_amthif_read(struct mei_device *d * remove message from deletion list */ - dev_dbg(&dev->pdev->dev, "amthif cb->response_buffer.size - %zd cb->buf_idx - %zd\n", + dev_dbg(&dev->pdev->dev, "amthif cb->response_buffer.size - %zu cb->buf_idx - %zu\n", cb->response_buffer.size, cb->buf_idx); /* length is being truncated to PAGE_SIZE, however, --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -849,7 +849,7 @@ int mei_cl_irq_write(struct mei_cl *cl, return 0; } - cl_dbg(dev, cl, "buf: size = %zd idx = %zd\n", + cl_dbg(dev, cl, "buf: size = %zu idx = %zu\n", cb->request_buffer.size, cb->buf_idx); rets = mei_write_message(dev, &mei_hdr, buf->data + cb->buf_idx); --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -121,7 +121,7 @@ static int mei_cl_irq_read_msg(struct me 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_del(&cb->list); @@ -129,7 +129,7 @@ static int mei_cl_irq_read_msg(struct me } if (cb->response_buffer.size < buf_sz) { - cl_dbg(dev, cl, "message overflow. size %zd len %d idx %zd\n", + cl_dbg(dev, cl, "message overflow. size %zu len %d idx %zu\n", cb->response_buffer.size, mei_hdr->length, cb->buf_idx); buffer = krealloc(cb->response_buffer.data, buf_sz, GFP_KERNEL); @@ -150,7 +150,7 @@ static int mei_cl_irq_read_msg(struct me if (mei_hdr->msg_complete) { cl->status = 0; list_del(&cb->list); - cl_dbg(dev, cl, "completed read length = %lu\n", + cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); list_add_tail(&cb->list, &complete_list->list); } --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -262,7 +262,7 @@ static ssize_t mei_read(struct file *fil } /* now copy the data to user space */ copy_buffer: - dev_dbg(&dev->pdev->dev, "buf.size = %zd buf.idx = %zd\n", + dev_dbg(&dev->pdev->dev, "buf.size = %zu buf.idx = %zu\n", cb->response_buffer.size, cb->buf_idx); if (length == 0 || ubuf == NULL || *offset > cb->buf_idx) { rets = -EMSGSIZE;