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.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 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 E0E33C49EAB for ; Sun, 27 Jun 2021 08:48:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9EDF61C34 for ; Sun, 27 Jun 2021 08:48:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbhF0Iuy (ORCPT ); Sun, 27 Jun 2021 04:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbhF0Iuw (ORCPT ); Sun, 27 Jun 2021 04:50:52 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D719BC061574; Sun, 27 Jun 2021 01:48:26 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id f30so25712280lfj.1; Sun, 27 Jun 2021 01:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Dr7IlCFxFMjzD5ZoiWZkQrtRVuiEBN/27kUtcpWfMU=; b=TI3aLnYRD0arKqMnRsDNfa/vCBd+Y0g1C5LivRwwsMLRUzUasYfwVo84CC2nFbxR24 fhHPFLaop/O7TnCXlmdBKuZ2dVxcliIfIeXm60w+g8tbxvByi8kGWz//SguzkuXGKi3e hXsczrECSS/p45p3JFODhJYp1SVfWHVNClHNU3kDyy5v8MRF3W4qmwmsdXfCtRwl/USm u7anhww0TYZ6mWGFScQibL/ofbOsLVkmpWUqHkcwoYyGNHvfjBPdosFyx2XezOXGzTZk 442gVwS0SglQ7JkDiucb0FPREfd58fRHflgDLQHfa7pK03paeVeJZWGxDG4uzXHffGMF RsHw== 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:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Dr7IlCFxFMjzD5ZoiWZkQrtRVuiEBN/27kUtcpWfMU=; b=nhRjVnI6z3zSVJsWEXJERfqgjv9fKS7M87d+L3Tb67rtH2rfE1EUam6fj9Gl4NhOBx R9nOr2i5Tsi5WjWez8SOgkPBOHej2vLUEfkq/e/YlvfIcBYEJmgi2rdJWwPxiseIN6Yz dbfH6T1qiypbBKILKjttAwglszya8zVREsMS4rPKx8576gM8dMrOl+azRUqis4BpQ3hI yFH4mJeZWDZPDPXBlwh5MGdUBHsvtwRWPMBbMU3j/tMcCIGm/2WtqBz/eoweXwoQcGas LNk39EnAC1Jf01r1qM4CuXDfHORc0W5hj5R8c6m9cH3WChM6TTosd+i1r4w++k7ZZDyD JoSA== X-Gm-Message-State: AOAM5318ISyl5JhONODnjndFwh0v19fk0AsWuXVwa1amxOSxz8mA19ON VRhxpnpKu93/vLKfysWn4tY= X-Google-Smtp-Source: ABdhPJzR+MkVprcpoGGzZSSVXUV+lH5UnwMEPYmOcsb2fn4Bud+wu9dT2w8b64laAvqaUxWHv5HElw== X-Received: by 2002:a05:6512:32a6:: with SMTP id q6mr15279057lfe.308.1624783705197; Sun, 27 Jun 2021 01:48:25 -0700 (PDT) Received: from localhost.localdomain ([185.215.60.89]) by smtp.gmail.com with ESMTPSA id b7sm982604lfb.121.2021.06.27.01.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 01:48:24 -0700 (PDT) Date: Sun, 27 Jun 2021 11:48:16 +0300 From: Pavel Skripkin To: Aaro Koskinen Cc: gustavoars@kernel.org, sam@ravnborg.org, tomi.valkeinen@ti.com, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] OMAP: DSS2: OMAPFB: fix potential GPF Message-ID: <20210627114816.5e9d042b@gmail.com> In-Reply-To: <20210626231423.GA38365@macbook.musicnaut.iki.fi> References: <20210625223323.13930-1-paskripkin@gmail.com> <20210626231423.GA38365@macbook.musicnaut.iki.fi> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 27 Jun 2021 02:14:23 +0300 Aaro Koskinen wrote: > Hi, > > On Sat, Jun 26, 2021 at 01:33:23AM +0300, Pavel Skripkin wrote: > > In case of allocation failures, all code paths was jumping > > to this code: > > > > err: > > kfree(fbi); > > kfree(var); > > kfree(fbops); > > > > return r; > > > > Since all 3 pointers placed on stack and don't initialized, they > > will be filled with some random values, which leads to > > deferencing random pointers in kfree(). Fix it by rewriting > > error handling path. > > They are initialized before the first goto: > > [...] > fbi = NULL; > var = NULL; > fbops = NULL; > > fbi = kzalloc(sizeof(*fbi), GFP_KERNEL); > if (fbi == NULL) { > r = -ENOMEM; > goto err; > } > [...] > Hi! Im sorry for this, I should not stay to late night reviewing the code next time :( With regards, Pavel Skripkin 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=-2.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_RED,USER_AGENT_SANE_2 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 6781DC48BC2 for ; Sun, 27 Jun 2021 08:48:32 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 1274A61C32 for ; Sun, 27 Jun 2021 08:48:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1274A61C32 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D213A40153; Sun, 27 Jun 2021 08:48:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id skJX6wIZ-82K; Sun, 27 Jun 2021 08:48:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id BED034002B; Sun, 27 Jun 2021 08:48:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9A6FBC0010; Sun, 27 Jun 2021 08:48:30 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7C97C000E for ; Sun, 27 Jun 2021 08:48:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A56E383123 for ; Sun, 27 Jun 2021 08:48:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TGDU-i9Fd14I for ; Sun, 27 Jun 2021 08:48:27 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by smtp1.osuosl.org (Postfix) with ESMTPS id 45A8181B10 for ; Sun, 27 Jun 2021 08:48:27 +0000 (UTC) Received: by mail-lf1-x132.google.com with SMTP id a18so3427748lfs.10 for ; Sun, 27 Jun 2021 01:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Dr7IlCFxFMjzD5ZoiWZkQrtRVuiEBN/27kUtcpWfMU=; b=TI3aLnYRD0arKqMnRsDNfa/vCBd+Y0g1C5LivRwwsMLRUzUasYfwVo84CC2nFbxR24 fhHPFLaop/O7TnCXlmdBKuZ2dVxcliIfIeXm60w+g8tbxvByi8kGWz//SguzkuXGKi3e hXsczrECSS/p45p3JFODhJYp1SVfWHVNClHNU3kDyy5v8MRF3W4qmwmsdXfCtRwl/USm u7anhww0TYZ6mWGFScQibL/ofbOsLVkmpWUqHkcwoYyGNHvfjBPdosFyx2XezOXGzTZk 442gVwS0SglQ7JkDiucb0FPREfd58fRHflgDLQHfa7pK03paeVeJZWGxDG4uzXHffGMF RsHw== 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:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Dr7IlCFxFMjzD5ZoiWZkQrtRVuiEBN/27kUtcpWfMU=; b=ZBNFyJzMtDz2srtVTrVYr/B67yvChU4ulVeuSdk3PaLpHBVYiNLfAHXKnmXeNLzK05 l0SAEtUtiiZk4S9te4DRa8edYow7qQgFlqJWrfJpedWT3dxG2XHsCI3erwBuouhEriWo vBABai9EBOlikO4/+kWCerZhhaFphY+xk3hs+d8Xd6w/wodKpXaStTAqtK9t0KPyC1CL 2+ZqS/TSy4oXrGpUipEGNWsU72lwa1Qf93w9ne9z7vd/F48H4XU+mMAoJs7XaPLjCFex q33ZIyOnqqSSe+Mc1qM28/xTUyek9KtOFbV/qleTVoONIC5XPkZmL/rlRHJhbYNXsUGA YtLQ== X-Gm-Message-State: AOAM533PCyTCI+ZovmgeiopmGhhLtma/mGTTV/NASEe6haUWC/aHOStL cbVdO55RRaH9T4lu3SCN34w= X-Google-Smtp-Source: ABdhPJzR+MkVprcpoGGzZSSVXUV+lH5UnwMEPYmOcsb2fn4Bud+wu9dT2w8b64laAvqaUxWHv5HElw== X-Received: by 2002:a05:6512:32a6:: with SMTP id q6mr15279057lfe.308.1624783705197; Sun, 27 Jun 2021 01:48:25 -0700 (PDT) Received: from localhost.localdomain ([185.215.60.89]) by smtp.gmail.com with ESMTPSA id b7sm982604lfb.121.2021.06.27.01.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 01:48:24 -0700 (PDT) Date: Sun, 27 Jun 2021 11:48:16 +0300 From: Pavel Skripkin To: Aaro Koskinen Subject: Re: [PATCH] OMAP: DSS2: OMAPFB: fix potential GPF Message-ID: <20210627114816.5e9d042b@gmail.com> In-Reply-To: <20210626231423.GA38365@macbook.musicnaut.iki.fi> References: <20210625223323.13930-1-paskripkin@gmail.com> <20210626231423.GA38365@macbook.musicnaut.iki.fi> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-suse-linux-gnu) MIME-Version: 1.0 Cc: linux-fbdev@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, gustavoars@kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com, linux-omap@vger.kernel.org, sam@ravnborg.org X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Sun, 27 Jun 2021 02:14:23 +0300 Aaro Koskinen wrote: > Hi, > > On Sat, Jun 26, 2021 at 01:33:23AM +0300, Pavel Skripkin wrote: > > In case of allocation failures, all code paths was jumping > > to this code: > > > > err: > > kfree(fbi); > > kfree(var); > > kfree(fbops); > > > > return r; > > > > Since all 3 pointers placed on stack and don't initialized, they > > will be filled with some random values, which leads to > > deferencing random pointers in kfree(). Fix it by rewriting > > error handling path. > > They are initialized before the first goto: > > [...] > fbi = NULL; > var = NULL; > fbops = NULL; > > fbi = kzalloc(sizeof(*fbi), GFP_KERNEL); > if (fbi == NULL) { > r = -ENOMEM; > goto err; > } > [...] > Hi! Im sorry for this, I should not stay to late night reviewing the code next time :( With regards, Pavel Skripkin _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees 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=-2.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 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 5DAF7C49EAB for ; Mon, 28 Jun 2021 07:06:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 257FE61A0F for ; Mon, 28 Jun 2021 07:06:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 257FE61A0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39E1689FA9; Mon, 28 Jun 2021 07:06:07 +0000 (UTC) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id C1D256E02F for ; Sun, 27 Jun 2021 08:48:26 +0000 (UTC) Received: by mail-lf1-x133.google.com with SMTP id q16so11463887lfr.4 for ; Sun, 27 Jun 2021 01:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Dr7IlCFxFMjzD5ZoiWZkQrtRVuiEBN/27kUtcpWfMU=; b=TI3aLnYRD0arKqMnRsDNfa/vCBd+Y0g1C5LivRwwsMLRUzUasYfwVo84CC2nFbxR24 fhHPFLaop/O7TnCXlmdBKuZ2dVxcliIfIeXm60w+g8tbxvByi8kGWz//SguzkuXGKi3e hXsczrECSS/p45p3JFODhJYp1SVfWHVNClHNU3kDyy5v8MRF3W4qmwmsdXfCtRwl/USm u7anhww0TYZ6mWGFScQibL/ofbOsLVkmpWUqHkcwoYyGNHvfjBPdosFyx2XezOXGzTZk 442gVwS0SglQ7JkDiucb0FPREfd58fRHflgDLQHfa7pK03paeVeJZWGxDG4uzXHffGMF RsHw== 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:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Dr7IlCFxFMjzD5ZoiWZkQrtRVuiEBN/27kUtcpWfMU=; b=M4qGi0Wj8yfGbICvSvjMBocqhp6N9E71aIj/AtY7DLmYxXAhDKJGpbFfh79slYaA9V a9VHjX5cBENT3ODjkFz06rpvGCGpmHINcsQk01rurx9RdkWWOCft4mSzQv/0Ab4lhHVV hVhY75IjCi5KA89mw1uyzmlVajUy3pnTSsMFMa0dq5Wa9uLUjUWEBqZ1E4Gi9yQ3XaSp u0gBwE08sg0c0nXteEFPcGHCnkdp2oOmbGHTrrJhoDZ94+SRYB/p8q+umWWMYISIz2Ht Bpv9gcN2uGEOPrrha+tk5PpAV3CwlC6/+lBg0/mJ14hIPKM3k3mWKNd1fHQ4fM2fiUGE n5XA== X-Gm-Message-State: AOAM530z6N5r4hr+vgrXw2U+Rzi/pLfucpGuSsYrAPP1N3yqO/DbwPCV b1JEn7TQiM9NcmsHxk5IMqM= X-Google-Smtp-Source: ABdhPJzR+MkVprcpoGGzZSSVXUV+lH5UnwMEPYmOcsb2fn4Bud+wu9dT2w8b64laAvqaUxWHv5HElw== X-Received: by 2002:a05:6512:32a6:: with SMTP id q6mr15279057lfe.308.1624783705197; Sun, 27 Jun 2021 01:48:25 -0700 (PDT) Received: from localhost.localdomain ([185.215.60.89]) by smtp.gmail.com with ESMTPSA id b7sm982604lfb.121.2021.06.27.01.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 01:48:24 -0700 (PDT) Date: Sun, 27 Jun 2021 11:48:16 +0300 From: Pavel Skripkin To: Aaro Koskinen Subject: Re: [PATCH] OMAP: DSS2: OMAPFB: fix potential GPF Message-ID: <20210627114816.5e9d042b@gmail.com> In-Reply-To: <20210626231423.GA38365@macbook.musicnaut.iki.fi> References: <20210625223323.13930-1-paskripkin@gmail.com> <20210626231423.GA38365@macbook.musicnaut.iki.fi> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 28 Jun 2021 07:06:06 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, gustavoars@kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com, linux-omap@vger.kernel.org, sam@ravnborg.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sun, 27 Jun 2021 02:14:23 +0300 Aaro Koskinen wrote: > Hi, > > On Sat, Jun 26, 2021 at 01:33:23AM +0300, Pavel Skripkin wrote: > > In case of allocation failures, all code paths was jumping > > to this code: > > > > err: > > kfree(fbi); > > kfree(var); > > kfree(fbops); > > > > return r; > > > > Since all 3 pointers placed on stack and don't initialized, they > > will be filled with some random values, which leads to > > deferencing random pointers in kfree(). Fix it by rewriting > > error handling path. > > They are initialized before the first goto: > > [...] > fbi = NULL; > var = NULL; > fbops = NULL; > > fbi = kzalloc(sizeof(*fbi), GFP_KERNEL); > if (fbi == NULL) { > r = -ENOMEM; > goto err; > } > [...] > Hi! Im sorry for this, I should not stay to late night reviewing the code next time :( With regards, Pavel Skripkin