Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1052279ybl; Wed, 14 Aug 2019 09:58:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOmnOWR7dyPp6QzuZY9tTRZnAFxYjCRWQyolckMTBKrvlch5bSbtFRhqkV4s21BUA4enyX X-Received: by 2002:a17:90a:9f4a:: with SMTP id q10mr645970pjv.95.1565801936265; Wed, 14 Aug 2019 09:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565801936; cv=none; d=google.com; s=arc-20160816; b=lrik/SBwUMO376tn8thwCyt73N0tZZU34zIrHx0CQJK7jPOPP1V68A+n5Y+W8tk/08 qFwizXycXggSZFZhMzzf3/OmxfjkJOsS7bqRo1iRYvyfvrfHETYmAAQclM43F3z6G1Je YosqaoRRTrzzvvOVRz3wleEdb8x1lVl7zWMSZHNovk1RthrbWG7/bJ8n1mMBiEt5XSHa yVrHo4qTZ6mIqB9BQw/KX5x+v26Vlzo70RbIMaN9sOeaVGlYVWdohUopl9NHIfgVaWTw T40L+fA5Uj6xFazyu4a2sEE+P7JGlR2Yv50L5Lq/Ny4tc0I7IPE7MQz3wJR6z7TAJpr1 zIQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MTEkYKL8BVYhxHYUGvIBzu9AUXRPM4JLAqesOWugBI4=; b=ki3/0mVo8bJWfN2flN3898eFJ5Ei/HxPbScZ8nYjOvVv6UNC0IA+FDHvBD1r92htge XdCHcS5bIte4VsuC6UT73C80b0/GJIHce6nJA8g28djKV08e0Pj5jtjtr8ApH1mjdlRZ B73uXt4OLiTk+KakKcNUQ29llIWwX6Aok+dFOsHk6PJkU4RUkdZSKJGANrvmqgdr1ctv oxzqQaihJkiDNMV1rM33MsHMX8befLomGuDmP1K9C+ScMxXizi0Z9olf8NYL/c2gZNFV 6xE0wBVBYu2TUuhQ12CXlxW5JkdIGxBueiXDhRsflbXB7FZbDilzs4B87+84Yn6SNkPy ctdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XW6JU+74; 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 b5si186149pjo.26.2019.08.14.09.58.39; Wed, 14 Aug 2019 09:58:56 -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=XW6JU+74; 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 S1728343AbfHNQ6D (ORCPT + 99 others); Wed, 14 Aug 2019 12:58:03 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38570 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfHNQ6C (ORCPT ); Wed, 14 Aug 2019 12:58:02 -0400 Received: by mail-wm1-f66.google.com with SMTP id m125so5059890wmm.3; Wed, 14 Aug 2019 09:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MTEkYKL8BVYhxHYUGvIBzu9AUXRPM4JLAqesOWugBI4=; b=XW6JU+744xiPyvNGXbdLzF9iT8xBjUrwuGqjiEzePGIE10acGza/QX9wb4sifiJBAM s+Vyy/HYTvljbdR154FO5gtmYoW1+UlIcJRZC9sXJuXt1rDFpF/OQwU0XchQtQblKFbc IkklEWAlaDopBwgale8LaS9oJ0BfMiMIf2P5Nf2A2xJh3tCNntxuMYi6K/sZSEDYpkBY BNknRECBO3vUKy9XXwwvOCy0UiOp5wehR1znL40YUof9CC48bZXbB8MA0F/O+O5wI/ll bhPZL/2ucJSM9SDYCOe08SqxFuKEREop4O6V9kG+Jmm0KY45RiDm46Dt3cDJD2ouV5lm UXoQ== 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=MTEkYKL8BVYhxHYUGvIBzu9AUXRPM4JLAqesOWugBI4=; b=IMRRaITUThNW8X0GDlfDRHchVTbSGB0Zl/OTkJCFXVKTdngbvuryXTwJfgKPiOnT93 pLOXSvnxdb1eViQbRKtyOd/fw9FSco5o1lIzGGdbmcfjjclP955RMWfXPs/I1LYppgVD 69/PxO4a//G79FrXaXo2FVNvlKJbFQuGrEm4HQFPGOvhJOBt71wSHmv23EXrvdQmjr/C 7eQqQI7osRyWWPRcQ6bIYLHQC+tmtRxZEugC3MfFo5P25NkmCQV8sYo1OpUnETWRPbSP OugScLkieW77mKuSRTjF5LXrSpgCpMv4rTzMfj+qbbWwZ4u6mVLWLZJ6XHsA0iZwQLth AkVA== X-Gm-Message-State: APjAAAVvkFqjpexBZzmVj+wi6Xf+Ckv/pHUkuhfakmhbhcVy24SncZVa 6714H2EACqXkmB7sC+Axnd1wMJeepmSuSWVvd4c= X-Received: by 2002:a05:600c:54c:: with SMTP id k12mr79276wmc.117.1565801879761; Wed, 14 Aug 2019 09:57:59 -0700 (PDT) MIME-Version: 1.0 References: <20190809103235.16338-1-tbogendoerfer@suse.de> <20190809103235.16338-10-tbogendoerfer@suse.de> <20190814163733.82f624e342d061866ba8ff87@suse.de> In-Reply-To: <20190814163733.82f624e342d061866ba8ff87@suse.de> From: Jonas Gorski Date: Wed, 14 Aug 2019 18:57:55 +0200 Message-ID: Subject: Re: [PATCH v4 9/9] Input: add IOC3 serio driver To: Thomas Bogendoerfer Cc: Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Srinivas Kandagatla , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Network Development , linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Aug 2019 at 16:37, Thomas Bogendoerfer wrote: > > On Wed, 14 Aug 2019 15:20:14 +0200 > Jonas Gorski wrote: > > > > + d = devm_kzalloc(&pdev->dev, sizeof(*d), GFP_KERNEL); > > > > &pdev->dev => dev > > will change. > > > > > > + if (!d) > > > + return -ENOMEM; > > > + > > > + sk = kzalloc(sizeof(*sk), GFP_KERNEL); > > > > any reason not to devm_kzalloc this as well? Then you won't need to > > manually free it in the error cases. > > it has different life time than the device, so it may not allocated > via devm_kzalloc > > > > +static int ioc3kbd_remove(struct platform_device *pdev) > > > +{ > > > + struct ioc3kbd_data *d = platform_get_drvdata(pdev); > > > + > > > + devm_free_irq(&pdev->dev, d->irq, d); > > > + serio_unregister_port(d->kbd); > > > + serio_unregister_port(d->aux); > > > + return 0; > > > +} > > > > and on that topic, won't you need to kfree d->kbd and d->aux here? > > that's done in serio_release_port() by the serio core. i see. But in that case, don't the kfree's after the serio_unregister_port's in the error path of the .probe function cause a double free? Regards Jonas