Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp12196pxb; Fri, 15 Jan 2021 04:39:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUsytN3cuNBf2P1H9rYcPfR9BorcQ4VWJaECplYw7WntoT6qvr2D51qjROtTCKgyL9GqO7 X-Received: by 2002:aa7:db01:: with SMTP id t1mr9378150eds.185.1610714350199; Fri, 15 Jan 2021 04:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610714350; cv=none; d=google.com; s=arc-20160816; b=wksF5gP57TZzrMj2rT6dx3/IEI8nM6sVcY2j0jd6b1Ol0+pIIg9EO6v7kKhTGEi1Mt nzxHMq5rqieiv1vnBtTkglbQqIeyeKkWIqnktlM0/ztOQeWOYuB0olugt0FfJ4UPUZKq hFSj/P48kkNPNrlX7VqlGojyBTVfaimBk3imKZuJzLw5xv0uy6U+Kwm0ivztbuyJ1zyM I6J6woYPzEz248LoJbtR7OEQzCbm+x54g4cOiRbhDQQ2QiDdgHr8H+fPO8l8SknC3XlT 1s83G0WK/avdWK3enuJhzk3x70ZJR4VPI9NcDXIjW1LT6HbizUfJzgtgrxq+FaCrTCv6 dC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AhbiMniJ8dJoRtIC60LduNJYfakYtMlx6nGcUHJP9bE=; b=aAZ3Y+gQ5RD1WOIZ7/ZWkvIwiGD6eIniiutxeoO9rSFS6bvNVP757R3dc/8lOafBJU 3r1nnoNCvxGSMIQgIMqlHqsC0Oxz2oxmT5XtMPPR8+4nr2pazXgbazdNTMGFSXtlKbIJ 5+Gv9KZWDNlaJgCoF2JlPnAV8h96qWSLwp+NiH+WuwQ5LbcskacNv84tEI85nj0tWo8J cJpiVgtmnmqJJN+hPdhA526qrZN69PzHv+OoMSMH4FZE74QwPazZDYZceECQYB8fmBTt /oi8tO9ZVhTrW5Bj7c0vQaMO2nH8O5EVbO7lFQB9ZZVCFEWeS/9DaNWBhI084X0VpOKW AVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yonjiQi2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si3980737edr.303.2021.01.15.04.38.46; Fri, 15 Jan 2021 04:39:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yonjiQi2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387883AbhAOMg1 (ORCPT + 99 others); Fri, 15 Jan 2021 07:36:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:42974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387838AbhAOMgJ (ORCPT ); Fri, 15 Jan 2021 07:36:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 84588224F9; Fri, 15 Jan 2021 12:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714154; bh=d/iWsEUdnlQTdGh+bo7yZVe5IG3Yg4H7fcE/Trb2zaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yonjiQi2Rhoid3Utf7zxnFxNzSKDqYmnBLg485vXT8nd+rYvG5lKq91D8sowmO97q cZ9aIkj0FFzmhJzyvgxidMju9e1UvITP7GLbomeocCk0qR4dARCme++JJobrgXk2Fm f7sszm2mI+TlKcm50UNQ2joTdIDzRD7ZC9CjvnqA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shravya Kumbham , Radhey Shyam Pandey , Vinod Koul Subject: [PATCH 5.4 44/62] dmaengine: xilinx_dma: check dma_async_device_register return value Date: Fri, 15 Jan 2021 13:28:06 +0100 Message-Id: <20210115122000.529002889@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121958.391610178@linuxfoundation.org> References: <20210115121958.391610178@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shravya Kumbham commit 99974aedbd73523969afb09f33c6e3047cd0ddae upstream. dma_async_device_register() can return non-zero error code. Add condition to check the return value of dma_async_device_register function and handle the error path. Addresses-Coverity: Event check_return. Fixes: 9cd4360de609 ("dma: Add Xilinx AXI Video Direct Memory Access Engine driver support") Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1608722462-29519-2-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/xilinx/xilinx_dma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -2742,7 +2742,11 @@ static int xilinx_dma_probe(struct platf } /* Register the DMA engine with the core */ - dma_async_device_register(&xdev->common); + err = dma_async_device_register(&xdev->common); + if (err) { + dev_err(xdev->dev, "failed to register the dma device\n"); + goto error; + } err = of_dma_controller_register(node, of_dma_xilinx_xlate, xdev);