Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9766387imu; Wed, 5 Dec 2018 09:53:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/V34FqWDNkx3HKzAMYRYD/nuNA/V4et9b4IuQcQSdvhKrvS4bKt4u1vBnnu90RRlBUjUZTN X-Received: by 2002:a17:902:5a4d:: with SMTP id f13mr25971993plm.49.1544032422747; Wed, 05 Dec 2018 09:53:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544032422; cv=none; d=google.com; s=arc-20160816; b=l2AKPVgfPKfjV7T6ddtqDJG9BAzwM9LF2XjwXBqewu/dayjBqhthWINGyrgkGf8AOJ QZnjn6dc4VnuMrRf00YKUhkTev2u85iVzipeVULGh1xTIi+9SJ7Kl2nf+ziqqj0Q/gts GnSMb6+0l96ue0sQFmuXHImoYTUDcISCVJDRKQKegJlrNiQjeoPjo21TbJHVa52D7rpZ JJE3NJ21yLU2zJaZ0v+f+hv5q+d/JjUMOQFoTODnY7Mv18XMq6IuVlJbkmAdu0xXd4el R66RABGq8b1F9ghvjONjtssYxczmEmBPCCDUlDWoWx+vMO48/qeDmqCoENKDAcfpelEV vXQA== 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; bh=ibqsYSKAoSqnlOjk4KKyyzbiSkCmLucodSv4g6hHtWo=; b=x+KH5z74JjbcslRfMb6tTDri8ahqRE56dcEPWT7HQHpiD5pGKYpRU0VH883zwqcEcQ 2YFBUX7drYH/w9WnsuyfReGkONieY3hca8QUh18EDx1yQcPcPcmsSpWUG7GdDBcni3c9 Sap42cyZ7S2igWxcS532CbuhBI0+U3yel9MJeWu1dHMefy88G56laaPR/FOr/zvMcYBO 73BhAhtZFJ8rvaoDW6Lbyd1q/EWaaFyFLxXgzli9AEvBttuRbFeKVSv+qM9IlIlVw/X9 uzgLASVpQV0FWNeRNleSSGVfZbm2EIwd4oh+XzQ34A4hmlvDaou9ZL5rggaTx2VanmfP sdCw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si18303051pgq.402.2018.12.05.09.53.28; Wed, 05 Dec 2018 09:53:42 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727872AbeLERvP (ORCPT + 99 others); Wed, 5 Dec 2018 12:51:15 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46014 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbeLERvP (ORCPT ); Wed, 5 Dec 2018 12:51:15 -0500 Received: by mail-ot1-f66.google.com with SMTP id 32so19405045ota.12 for ; Wed, 05 Dec 2018 09:51:15 -0800 (PST) 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=ibqsYSKAoSqnlOjk4KKyyzbiSkCmLucodSv4g6hHtWo=; b=F6G7PCAwdPRGAg83mSyNFp9A6Fu3E2oUyQoveFS8CJWw7dfOxAWEUf+yJGqfEgwlOH AB4D6hhldF/xmOVjE9S/47uSZv6G449XR6P973uG7cDqb45i9ZnZ+lEPJBULh84QJV6j zbbI5jfdXvPHy2woToZBHMv31L5ShFu3NXngrl2f30ETFBlnVqqVBjaz+sot4V+7J8W8 QiOQfNudmGwvT7Udv4cdtWZ9RkZPvCdgobpxQtJ/QXUCp+6BoDfu4Hy2B+DcqhZGy3Qg cbB3Gb8s2xVQqbNcMaIYgTXpNDxXvNk/fPBI25Dj7eezZpiviQUtKbN+C/8/4GnUgjPT TA1A== X-Gm-Message-State: AA+aEWZEgJEygNVynP9n0fMwTTglVUwiWLYiD9vg7eyac7eZf3I7oglC RvoSzw0YJPSvazqJKaQEAEdaO2qEOEc= X-Received: by 2002:a9d:1f3:: with SMTP id e106mr4200762ote.369.1544032274514; Wed, 05 Dec 2018 09:51:14 -0800 (PST) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com. [209.85.210.48]) by smtp.gmail.com with ESMTPSA id t12sm11622357otk.61.2018.12.05.09.51.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 09:51:14 -0800 (PST) Received: by mail-ot1-f48.google.com with SMTP id v23so19419667otk.9 for ; Wed, 05 Dec 2018 09:51:13 -0800 (PST) X-Received: by 2002:a9d:65c8:: with SMTP id z8mr16231441oth.338.1544032273394; Wed, 05 Dec 2018 09:51:13 -0800 (PST) MIME-Version: 1.0 References: <1543922408-22950-1-git-send-email-ioana.ciornei@nxp.com> <1543922408-22950-2-git-send-email-ioana.ciornei@nxp.com> In-Reply-To: <1543922408-22950-2-git-send-email-ioana.ciornei@nxp.com> From: Li Yang Date: Wed, 5 Dec 2018 11:51:02 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] soc: fsl: dpio: cleanup the cpu array on dpaa2_io_down To: ioana.ciornei@nxp.com Cc: Roy Pledge , youri.querry_1@nxp.com, lkml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Ioana Ciocoi Radulescu , Horia Geanta 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 Tue, Dec 4, 2018 at 5:21 AM Ioana Ciornei wrote: > > The dpio_by_cpu array should not contain a reference to a freed dpaa2_io > object. This patch adds the necessary cleanup in dpaa2_io_down. Applied. Thanks. > > Signed-off-by: Ioana Ciornei > --- > Changes in v2: > - none > > drivers/soc/fsl/dpio/dpio-service.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c > index 9b17f72..21c3e32 100644 > --- a/drivers/soc/fsl/dpio/dpio-service.c > +++ b/drivers/soc/fsl/dpio/dpio-service.c > @@ -160,6 +160,11 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc) > */ > void dpaa2_io_down(struct dpaa2_io *d) > { > + spin_lock(&dpio_list_lock); > + dpio_by_cpu[d->dpio_desc.cpu] = NULL; > + list_del(&d->node); > + spin_unlock(&dpio_list_lock); > + > kfree(d); > } > > -- > 1.9.1 >