Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1095360ybi; Sat, 15 Jun 2019 20:16:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxE7LiTggAwdqkxoMLAukUSE5Y5hZ9tpdETZs8xK8n7Zd4iMOUlj9PWkixGMq/jQ7ikloTS X-Received: by 2002:a17:902:3a5:: with SMTP id d34mr16512024pld.239.1560655011259; Sat, 15 Jun 2019 20:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560655011; cv=none; d=google.com; s=arc-20160816; b=TiUIlgoZ2no9mAtPhvVnMVCouAwXncke/diE+ifb0erdCzVkl6hoFWRMQra3s3U6pF wug1ms5gG8obEKLHXYeT7iAxUrJywrr8FU13iyj+dHy8q1dNIbaS9nlitlr9KXbbAuto xlGt66V0qwg4TdZWeQYsgY+oHqGnrbrIVi22D6/LtAt9vqW9bZfnhyzLbag3pD3dRLSi 2/HvQ+KUA3kDq/zTPe56ryR+GkllQlG1f8rOSXDug0fBiXfo5ghgDjDIdJmihvFp7/ks xNVHs63BfT+gRRKHDgVGDgcPfrMIBI0P2zc1PJZsl5Q9iMf29ezDFWsfer9ph9a7ASLz 9jhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=rM+/ypTKzHDjmz5d8wUoyWYZZW60mbQw25HJyMsGcus=; b=LMWX5Ua/HWVmVf22U6S1yrvdzy1RL6dDX3fCUGh1CO61hvbs3LIkojyS1iJ0AQaO2F QPlFGQP/IBZOP1feKhJaIYoJxQmfjxHtCRsp1SawfCe5CBJyuFidb3lEd2AA0Nd2Hlfb OnJbnU+npoL+5Aem6LoL4WOFt+on8UkO3ywXrIWNC8Y89ZEPjgECsZMw2I6RJQIsa71a FTPN//FErWSTdXKRM7xBx1BmEx8zjfaHbqojJC1YvLzJ3qGFb/olr27nUYalq0w0Iyxa nQGhka5XvXnpaIswwXNw6WjmwdVQwAqh2BE5U+XUZctjLRJhu0oMvm1ctmWksFcMGxYF Eehw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g0E2MJVy; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r20si6270202pls.389.2019.06.15.20.16.21; Sat, 15 Jun 2019 20:16:51 -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=@gmail.com header.s=20161025 header.b=g0E2MJVy; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727044AbfFPDOR (ORCPT + 99 others); Sat, 15 Jun 2019 23:14:17 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35849 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbfFPDOR (ORCPT ); Sat, 15 Jun 2019 23:14:17 -0400 Received: by mail-pg1-f196.google.com with SMTP id f21so3834133pgi.3 for ; Sat, 15 Jun 2019 20:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=rM+/ypTKzHDjmz5d8wUoyWYZZW60mbQw25HJyMsGcus=; b=g0E2MJVyJwD8xzdXPW4vo5+svFBVDkX3MTAZMd/BVjkmU8RTOcXWTSqspOn9f2IdCa in3syGs281wTXIoJupcx6YFReM+1FWNyusQXDsL84KT/ueVNqDoCz0aMWXmcZE+KuJgM pzK6A8AfHIOPQ65RVGCE7B37O8lhw3ojjhkSdaWSjvQMb4yyXI6chs4jJnbu1lLHJbKb 6vEpb8fIZPy+pxXkv4wQPC4YXP9nZo1I6PYvcnonL/+q4MGfVjO1yf1iPwYXCLU6XzbN ciSKb0OsvgnINeFLiWb2YfPWfUcTIgmFKJwNLVUZ0F0FNRJp2/F91tGCQDMmwZK6FRlz p85g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=rM+/ypTKzHDjmz5d8wUoyWYZZW60mbQw25HJyMsGcus=; b=YDfQUDFxZa018opJRCiyfZSbQfvRse7UznFHm6ETlAiaLKO5XuCKMu6q0utYALI9XO G4mb+A9m62p+khKCcm64GAySuzBRk3LznqcusOF8oWcVi0yn3yVx8jM2bHMnwbiemRtW mEiJIrAGOlCGS7aJ+/YZAh1B/5y3YIexyZR2Q+wqz0mn9R4Pyg1JER+QF5UhtWKUgX9I W+arow7MgWrKfmHJg1HWd3jEeoZxs0PbDbn79bxTDGEHDZmJPW9G4Bn12A+vIXIvQvB6 5ExMn3/sbyUWie1CRcO5UBMX5gsE9YBM0MZ28sIBlR8B8ZpOHnVKxriVXFitJnKlaW23 iQ+Q== X-Gm-Message-State: APjAAAVrqTGNt9hHe2PQIEJjGa3Oi14jeQfc6BmVVl/LeB1SO1L9ktH9 RVZuiJVLS9epp4sruj9oOFM= X-Received: by 2002:a65:514a:: with SMTP id g10mr42838711pgq.328.1560654856182; Sat, 15 Jun 2019 20:14:16 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.89.153]) by smtp.gmail.com with ESMTPSA id l10sm746697pgm.26.2019.06.15.20.14.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jun 2019 20:14:15 -0700 (PDT) Date: Sun, 16 Jun 2019 08:44:09 +0530 From: Hariprasad Kelam To: Greg Kroah-Hartman , Hans de Goede , Arnd Bergmann , Colin Ian King , Hariprasad Kelam , Payal Kshirsagar , Madhumitha Prabakaran , Nishka Dasgupta , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723bs: hal: Add null check after memory allocation Message-ID: <20190616031409.GA13001@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add NULL check post call to rtw_zmalloc. Signed-off-by: Hariprasad Kelam --- drivers/staging/rtl8723bs/hal/sdio_ops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c index ac79de8..9177c18 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -816,6 +816,9 @@ void clearinterrupt8723bsdio(struct adapter *adapter) haldata = GET_HAL_DATA(adapter); clear = rtw_zmalloc(4); + if (!clear) + return; + /* Clear corresponding HISR Content if needed */ *(__le32 *)clear = cpu_to_le32(haldata->sdio_hisr & MASK_SDIO_HISR_CLEAR); if (*(__le32 *)clear) { -- 2.7.4