From patchwork Mon Mar 18 20:47:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10858553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DEEF1575 for ; Mon, 18 Mar 2019 20:47:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BB342947C for ; Mon, 18 Mar 2019 20:47:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FE1328F74; Mon, 18 Mar 2019 20:47:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 01B1528563 for ; Mon, 18 Mar 2019 20:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qItjItnFhqRHa7S6yBV0WxygMkt4TKxDVTPcf90Er6U=; b=VCsG2LyebHUhLy RubX7zo+u1718v862lSInf2Y3FqJHPSbPj6iJSIVzcxDjGce9isS8f+sthqNJVDe+4BNrZwgWZp+T 8Km4ZKK0/AlNU3CeCIcMVw/cFnwrfxPeLi14K/MO2c0iILbU+tWbzbiCqM7uOGRWMTHAmPKt2vILV hBEm/TvTidZmoZOofJe/b8iMs4mNjjIpB6iOh7CeVRaj9tKPFHuO+rxcLBbbJJ6jFDb16elNofL/R o7wRHjJO5WIyFvRqqW9pA/ORmCCO9+YB/0nkhzD9FgCnDMiL4JKiMvqcgtpFP0RjKPZQFadpa+Avd wwOTwhE3pX6UoXm9A9Pg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5zAS-00005w-Bz; Mon, 18 Mar 2019 20:47:32 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5zAP-0008WQ-F1; Mon, 18 Mar 2019 20:47:30 +0000 Received: by mail-wr1-x441.google.com with SMTP id j9so4470763wrn.6; Mon, 18 Mar 2019 13:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xdEjMClilgNv8/8kONKzwjjh/piLUyVN8GRovW1S520=; b=CIPOqkztsjF0JLMSRllS4l2mccMHIMLYaAz7gdg/mdMwXpDdJ9ReuODAQHuzQbXkjS kQq2iHPbq5BSznOZVbjyQ+z6mRjXvzHQ9JloW7GX3fiVdpqN7KoQeoQNHnSuyYCS0kvO KpOdDlwlTNC2aFQA8oPEQmVqPVnWmHKo47Tuy+xvi/6pbREcveueGEM1MaO+9d+pc4Gt 3OJe8is04jvXlDPnOiFXzxS5xjHuEpHcGjW3KQUAl/M8z1cnYsCqZNSR9hF2wsZwvLE3 Fpl8gHEos6FkjxTaWpFePDx1c95iIXpeZHfL34edKcE6qY+u5w7Iq/6dbnpelnXWB4IG vwXg== 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:mime-version :content-transfer-encoding; bh=xdEjMClilgNv8/8kONKzwjjh/piLUyVN8GRovW1S520=; b=fZMcdSBdiT6qwNgxOXREbi6gpXbCBreP9qJiMswLES2b20lAPxrqze14Oz0WGPCXpT C7PGfdjCdeT9eMwVDkPORSVaWoiFZmwz1pZosA+6OthfftUxb+nQvBqarVn5xGZMLROe FHtH9tiiYdsMffjFHzfrWwFohtQxxMoDUfnw+U5edFiUSKvaAYA86atVpfT+MWGugjcT 0Ugmkku1o6pu+t+4dT7AfWEHVLs24UQ8GupeUxabUdV+GwvzMzEZ0zEqzNMb5QCXsRpn 4obLCl/YAZmcGtWpSmtTcvJx5NFVSq0NA7qstvg9LSUsdO87hYqT9GgaV5OkmpmdD6Qh Hdlg== X-Gm-Message-State: APjAAAVIBX6jNiJu43biCgqxUyKZfK7p+hZBN9/4wpOvEYfrK/GDGYx+ OEFgoObe9zyt8VsC9a9PQXMpY33u X-Google-Smtp-Source: APXvYqyAj6VPfPkkwt0HGRwCHv7yvs/hbUKdXalZBFEtOcrjvQmJ0Y4YnXiV7Nga5VPbpKF8Z8Z5sg== X-Received: by 2002:adf:82c9:: with SMTP id 67mr5757540wrc.261.1552942047561; Mon, 18 Mar 2019 13:47:27 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7399900918378ACFECF051C.dip0.t-ipconnect.de. [2003:dc:d739:9900:9183:78ac:fecf:51c]) by smtp.googlemail.com with ESMTPSA id y12sm224849wma.44.2019.03.18.13.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 13:47:26 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-mtd@lists.infradead.org, bbrezillon@kernel.org, miquel.raynal@bootlin.com Subject: [PATCH v2 0/2] meson-nand: two small memory related fixes Date: Mon, 18 Mar 2019 21:47:20 +0100 Message-Id: <20190318204722.9901-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190318_134729_507232_6E38A261 X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , richard@nod.at, liang.yang@amlogic.com, linux-kernel@vger.kernel.org, jianxin.pan@amlogic.com Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP While trying to add support for older Meson SoCs to the meson-nand driver I was experiencing a crash in meson_nfc_read_buf(). While trying to find out why that happened I inspected the code in that function and found that there's: - a missing check on the return value of a kzalloc() call - a potential memory leak in it Both fixes have nothing to do with my original crash (for which I'll open a separate thread). Changes since v1: - collected Liang's Acked-by's (thank you!) - rebased on top of v5.1-rc1 Martin Blumenstingl (2): mtd: rawnand: meson: add missing ENOMEM check in meson_nfc_read_buf() mtd: rawnand: meson: fix a potential memory leak in meson_nfc_read_buf drivers/mtd/nand/raw/meson_nand.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)