Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750934AbbB1GBF (ORCPT ); Sat, 28 Feb 2015 01:01:05 -0500 Received: from mail.windriver.com ([147.11.1.11]:36846 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbbB1GAx (ORCPT ); Sat, 28 Feb 2015 01:00:53 -0500 From: To: , CC: , , , , , , , Subject: [PATCH 3/4] crypto: caamhash: add two missed dma_mapping_error Date: Sat, 28 Feb 2015 14:00:33 +0800 Message-ID: <1425103234-31129-3-git-send-email-yanjiang.jin@windriver.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1425103234-31129-1-git-send-email-yanjiang.jin@windriver.com> References: <1425103234-31129-1-git-send-email-yanjiang.jin@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1419 Lines: 43 From: Yanjiang Jin Add two missed dma_mapping_error() after dma_map_single(). Signed-off-by: Yanjiang Jin --- drivers/crypto/caam/caamhash.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index f347ab7..f6ad322 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -160,6 +160,10 @@ static inline dma_addr_t map_seq_out_ptr_result(u32 *desc, struct device *jrdev, dma_addr_t dst_dma; dst_dma = dma_map_single(jrdev, result, digestsize, DMA_FROM_DEVICE); + if (dma_mapping_error(jrdev, dst_dma)) { + dev_err(jrdev, "unable to map dst dma\n"); + return -ENOMEM; + } append_seq_out_ptr(desc, dst_dma, digestsize, 0); return dst_dma; @@ -173,6 +177,10 @@ static inline dma_addr_t buf_map_to_sec4_sg(struct device *jrdev, dma_addr_t buf_dma; buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE); + if (dma_mapping_error(jrdev, buf_dma)) { + dev_err(jrdev, "unable to map buf dma\n"); + return 0; + } dma_to_sec4_sg_one(sec4_sg, buf_dma, buflen, 0); return buf_dma; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/