Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp167884ybh; Tue, 17 Mar 2020 20:31:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtnPyPt5nZ4vGdoozs6vGmNHkvCqIQtuMn4Jw4PBHTr0xKsOi99QI2LIAnstShs3AX1s31O X-Received: by 2002:a9d:22:: with SMTP id 31mr2009060ota.173.1584502301896; Tue, 17 Mar 2020 20:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584502301; cv=none; d=google.com; s=arc-20160816; b=z0DlYqfUCJdpCSW4NEEI6Y5JqR9gzMsw25FLJneDFxjI55fVuJgvusMiSuunXO5Imy 71M9u7adq1M57CPneGBEdMWgNYGSTsar4sbt/cL5Ej4bn31BLvu9djMlZSKRe/hs8YSv getxKYURTYPD/pGmsl+fvD2MsPqg5YGM1KLlQXpIk3Pt3lFwXeSXQYcw0IjfVYfeHwyX j6lUqdFL3Ujd55WSgXJg3e1fJ6k9TgdxHOJu1+LbQEB/gr0Im6OO10IgzkslfcY7/FD7 RK0uW+emLjOTYkAxHvrihWeqdhVVmJXZyqMvPPwyY7A0MAJwSctEz95/AzJ+2UHOCpWc XSew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=aIT1zTK9Ocso7RE9WeFEQk5SlR5xoNixSCclsbBUu/g=; b=mEL5dcf5Xs0yWG8bUiZF9rBJZZiDx1/hM0Kxhv6D9NxkzcZe/fVMxTCGU914y+5f3b MQO76X5MAKWWiUeNHk9z2GFT2lANQYU8zmDEqTky16mXTZs87IOADort+zeJVjw78LEO WIgESqZpUSC1sGPBQ9B4jZrBAN2L8B4+z0hbwfku0mnO5oZO5Nl0oQ1fcr1DqA6s5SlP MKE4TPLG0n9kfBW+6xjw1autUGVShJadiIN5JuCwsva6B9jBD+z3TIlSVlnC9pT5AeJs MwPE3p6MUT8SySdvms8xo3RE3gV8JoIWAX4oQ94tTxwyHYBzqIr5qjN/JvDvVVh3P3yF bztQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=KNcCj7O6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si2505381oth.209.2020.03.17.20.31.29; Tue, 17 Mar 2020 20:31:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=KNcCj7O6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbgCRDbL (ORCPT + 99 others); Tue, 17 Mar 2020 23:31:11 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46448 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726250AbgCRDbL (ORCPT ); Tue, 17 Mar 2020 23:31:11 -0400 Received: by mail-wr1-f68.google.com with SMTP id w16so12034022wrv.13 for ; Tue, 17 Mar 2020 20:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=aIT1zTK9Ocso7RE9WeFEQk5SlR5xoNixSCclsbBUu/g=; b=KNcCj7O6ttPqHHD/f7f7kRJ38s/SgzALF5DtpnS4WUODbYaxIrhIBM0SjK0Z5AUbKP ScckZfkZgdubMBTtD5LbY5NXhEjFj/+3IWV5ERArTHilG/ew6N7rfmOoKJIWCBnQxfCq 01XZzw+9njVxiksAXjjEY9I9S+x0aSqE9iDRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aIT1zTK9Ocso7RE9WeFEQk5SlR5xoNixSCclsbBUu/g=; b=oOjTlU5fM/knPCo28ztx9mw426IvAeo5vEO3DtLaOwPuqQnBUx/ZVEPDdkkjGDIO3G ZX3OJoUTab2MtNs+FRm5TzR5sIrNkO5SXEZD8QzcbLtSir9gDGC0BpJSbWsHqTlTwvWB PD98WTWqQstJcdhIAzbSQ5b71QwdduP995t9/BNR+k0tnM2ogzKPT17n2KjizsvM6C66 zktmT1reNDB/588r3N+jhqKjsuC1oNBmGusQOp4Y9xW901XrIdGgR7gmi7N9xEtaFm7Q m/4jy6BoUB+NfXPoSgk7NaPRKYHGze9nyilCGgQ6BBLM1buggrKk9eSveGiugAlZQ8ba VY/g== X-Gm-Message-State: ANhLgQ3P79hv8ctaWhpt5VRNACC0x01yUhGSCV9CR9At7A+L0fqi6vSQ Zf1L26ePakmdoBLqg/rf+x0itEwaaIw= X-Received: by 2002:a5d:488c:: with SMTP id g12mr2669622wrq.67.1584502267780; Tue, 17 Mar 2020 20:31:07 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id f17sm7664084wrj.28.2020.03.17.20.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 20:31:06 -0700 (PDT) From: Rayagonda Kokatanur To: Jassi Brar , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, BCM Kernel Feedback Cc: Rayagonda Kokatanur Subject: [PATCH v2 1/1] maillbox: bcm-flexrm-mailbox: handle cmpl_pool dma allocation failure Date: Wed, 18 Mar 2020 09:00:55 +0530 Message-Id: <20200318033055.5335-1-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Handle 'cmpl_pool' dma memory allocation failure. Fixes: a9a9da47f8e6 ("mailbox: no need to check return value of debugfs_create functions") Signed-off-by: Rayagonda Kokatanur --- Changes from v1: - Address code review comments from Tyler Hicks, Add missing Fixes tag. drivers/mailbox/bcm-flexrm-mailbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c index 8ee9db274802..bee33abb5308 100644 --- a/drivers/mailbox/bcm-flexrm-mailbox.c +++ b/drivers/mailbox/bcm-flexrm-mailbox.c @@ -1599,6 +1599,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev) 1 << RING_CMPL_ALIGN_ORDER, 0); if (!mbox->cmpl_pool) { ret = -ENOMEM; + goto fail_destroy_bd_pool; } /* Allocate platform MSIs for each ring */ @@ -1661,6 +1662,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev) platform_msi_domain_free_irqs(dev); fail_destroy_cmpl_pool: dma_pool_destroy(mbox->cmpl_pool); +fail_destroy_bd_pool: dma_pool_destroy(mbox->bd_pool); fail: return ret; -- 2.17.1