From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67F18C4363C for ; Wed, 7 Oct 2020 08:34:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D59432076C for ; Wed, 7 Oct 2020 08:34:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q93vXL0n"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zlkXAH7C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D59432076C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i6NhQycwZzxwUUm66yHycHhtdUIgT6kgaUkIIZBwuXI=; b=q93vXL0n4Ss21sKSs4jom/Q7d TRJqLPe1GigpTgg2879AIwM1Qw5IbXtzFCcF5LLp0hemsnsk8Vc4C4DNoea58FrpPpCYfCZihmYiZ Mv02Ju8w+dI96K2Jo2oFycZ+d2L7mtdEsNMsCa1cP8sj5Z9+nrushsxAvigUw7ZeGV2Bu2IHGRTkK Q98i4I/e9yqCykg5tbplQ6XBJrc5KpZpBkzzvN1ljEvQ0yt6k4+BJ9bRKf23qm7Zaazo352876mlq xPxT2aOHVShNneLhwCkunveYkd8YabMdkhoeQCoHptt0NSe5xLAbSY+lxbewJeE5CuAknExxsCTpR ex0vL5KNw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ4t0-0003Pd-FB; Wed, 07 Oct 2020 08:33:22 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ4sv-0003Nn-3O for linux-arm-kernel@lists.infradead.org; Wed, 07 Oct 2020 08:33:18 +0000 Received: by mail-lj1-x241.google.com with SMTP id p15so1107148ljj.8 for ; Wed, 07 Oct 2020 01:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mxByRzXtS14P4/kqXsVlalifhyVtmDWn1V/36Wva2yE=; b=zlkXAH7C+iLOICHOA8Pq+0jVGANDe3vr5yJxegEhyP9GdzD5Ro+DCLbvPEYzV9sXBV /2s8dUQa0i7Ctd5fV2h236vgbZzuI4gYBaNhs36z0Sl6ytH5y7kQ7XCDJnjJA6C3NS9y 7EnnC85Ao0BTyqqyh5W2iy12XQ+uf/4ftN4Xt2x93y/eVG9jivjPnkUUD38bRb4HL4Ss l4cHCTq6BXq91NwKjXPPOpt5EwvbZxDFhXFz45rdtQe08/cONAesVyvwvRdNHczv0t/c oVS+Cj6qES4lDsBQsgpD6RTypDAZVbyjbOzaW85ZcHLvvdBRyrAjJBRhUdWTj1my/SwQ fIWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mxByRzXtS14P4/kqXsVlalifhyVtmDWn1V/36Wva2yE=; b=bBKQVFjy/a1AmTVGItD2PzQu9y/L7MjO3MsQZks2tqV2t67k2Y25HBBaI7NNiLCWkt 3X3cp5slExtwVKOBP4wvv/ASMO2g5HLlchcx79/o1yl2WWvGvwTpUc/SQsPbCugRvm+r phTk0YYesMc9zRW+qDyiniZqrHClPhcQwXeqEF841Ma+RFcUQFxKNyjmdV5HAwPt3t36 EEkFYIWK+Hw7HgtcQHfKM2GYcZJPby4Y2QynqiubP7Nd2D5wpYwCx3MctKsbUCgQOi+K 9YMbLHw0FiqEsTMQA6y6QYOrKWafQ0OMysOAWw9GpgiiIa39EhpcCR/Py/M8bDeWy5kZ 2ErA== X-Gm-Message-State: AOAM531hOBln2emaa6XSinVb4/lWkcu6UqXNiAdEQbyVymlll1HLDymG uHRjuwMcekhVw1rHTxgkPdNckL2FVH4R9CVV8clwPg== X-Google-Smtp-Source: ABdhPJxRwSM+vB7wFf7q0lCzYpkrH6QvTnRgE3TO454T8PFfp63JkFd5ISVqjKk0EWNZk8om1x7APCPRrmErvWxIPaY= X-Received: by 2002:a2e:3311:: with SMTP id d17mr830847ljc.293.1602059593872; Wed, 07 Oct 2020 01:33:13 -0700 (PDT) MIME-Version: 1.0 References: <20201001142511.3560143-1-enric.balletbo@collabora.com> In-Reply-To: <20201001142511.3560143-1-enric.balletbo@collabora.com> From: Linus Walleij Date: Wed, 7 Oct 2020 10:33:02 +0200 Message-ID: Subject: Re: [PATCH v3] pinctrl: mediatek: Free eint data on failure To: Enric Balletbo i Serra X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201007_043317_357525_1CEB7EC6 X-CRM114-Status: GOOD ( 11.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Boichat , Sean Wang , "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" , "moderated list:ARM/Mediatek SoC support" , hsinyi@chromium.org, Matthias Brugger , Collabora Kernel ML , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 1, 2020 at 4:25 PM Enric Balletbo i Serra wrote: > The pinctrl driver can work without the EINT resource, but, if it is > expected to have this resource but the mtk_build_eint() function fails > after allocating their data (because can't get the resource or can't map > the irq), the data is not freed and you end with a NULL pointer > dereference. Fix this by freeing the data if mtk_build_eint() fails, so > pinctrl still works and doesn't hang. Patch applied after rebasing it. It wasn't entirely trivial so check the result. This will not apply on elder kernels and is now targeted for v5.10. Fixes for v5.9 and stable will have to be backported once this is upstream. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel