stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code" has been added to the 4.2-stable tree
@ 2015-09-26 17:48 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-09-26 17:48 UTC (permalink / raw)
  To: dan.carpenter, axel.lin, gregkh, wsa; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code

to the 4.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i2c-xgene-slimpro-dma_mapping_error-doesn-t-return-an-error-code.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From a4a9a8cb3248b3b48a6049acaeaf23d4ad3712b9 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 18 Aug 2015 12:12:19 +0300
Subject: i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code

From: Dan Carpenter <dan.carpenter@oracle.com>

commit a4a9a8cb3248b3b48a6049acaeaf23d4ad3712b9 upstream.

The dma_mapping_error() function returns true if there is an error, it
doesn't return an error code.  We should return -ENOMEM.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/i2c/busses/i2c-xgene-slimpro.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/i2c/busses/i2c-xgene-slimpro.c
+++ b/drivers/i2c/busses/i2c-xgene-slimpro.c
@@ -198,10 +198,10 @@ static int slimpro_i2c_blkrd(struct slim
 	int rc;
 
 	paddr = dma_map_single(ctx->dev, ctx->dma_buffer, readlen, DMA_FROM_DEVICE);
-	rc = dma_mapping_error(ctx->dev, paddr);
-	if (rc) {
+	if (dma_mapping_error(ctx->dev, paddr)) {
 		dev_err(&ctx->adapter.dev, "Error in mapping dma buffer %p\n",
 			ctx->dma_buffer);
+		rc = -ENOMEM;
 		goto err;
 	}
 
@@ -241,10 +241,10 @@ static int slimpro_i2c_blkwr(struct slim
 	memcpy(ctx->dma_buffer, data, writelen);
 	paddr = dma_map_single(ctx->dev, ctx->dma_buffer, writelen,
 			       DMA_TO_DEVICE);
-	rc = dma_mapping_error(ctx->dev, paddr);
-	if (rc) {
+	if (dma_mapping_error(ctx->dev, paddr)) {
 		dev_err(&ctx->adapter.dev, "Error in mapping dma buffer %p\n",
 			ctx->dma_buffer);
+		rc = -ENOMEM;
 		goto err;
 	}
 


Patches currently in stable-queue which might be from dan.carpenter@oracle.com are

queue-4.2/i2c-xgene-slimpro-dma_mapping_error-doesn-t-return-an-error-code.patch
queue-4.2/v4l-xilinx-missing-error-code.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-26 17:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 17:48 Patch "i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code" has been added to the 4.2-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).