mei: fix format string in debug prints
authorAlexander Usyskin <alexander.usyskin@intel.com>
Wed, 17 Feb 2016 16:27:34 +0000 (18:27 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:05:49 +0000 (00:05 +0200)
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 <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/misc/mei/amthif.c
drivers/misc/mei/client.c
drivers/misc/mei/interrupt.c
drivers/misc/mei/main.c

index fb1c82f8db0214bd1dcaea3afa1e46f96d3a4574..cf120c5eb8060dc54b0871242c263f6d14d6bcda 100644 (file)
@@ -234,7 +234,7 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
                 * 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,
index 57af788ea05f88b6d734b74ecf1edc769438c7be..a4afa996d413034bbfc040742fb0e7baf5fff75e 100644 (file)
@@ -849,7 +849,7 @@ int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
                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);
index bc1c4f51bf9dba03b38513c75602248ef3e46808..41145e15289ebf7b97ded3dca593c0057a366a50 100644 (file)
@@ -121,7 +121,7 @@ static int mei_cl_irq_read_msg(struct mei_device *dev,
                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 mei_device *dev,
                }
        
                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 mei_device *dev,
                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);
                }
index adeb3c745b949664ce21f7341b5c88abb1758f8b..aed049d44a87af432b8656b6b6f47c1248641e03 100644 (file)
@@ -262,7 +262,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
        }
        /* 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;