Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp369297rdb; Thu, 18 Jan 2024 06:11:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFjiT59tNcWUnUSMpR7pifHNVsxgwYsmXOgUDevC1qnDY2ah6ITudo2fB7nmyEDGUulYY5 X-Received: by 2002:a05:6a21:3182:b0:19b:7cb3:6775 with SMTP id za2-20020a056a21318200b0019b7cb36775mr821065pzb.0.1705587070238; Thu, 18 Jan 2024 06:11:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705587070; cv=pass; d=google.com; s=arc-20160816; b=Jg4GWGWfvnhwcv9hiMSnumIpWvN+J8SSxdrRffJqmGKRGZMLxE5FPneJnAniM85itn vPxklFyjZ2OUXP7heXiJxMj6l73Zb11u0+MoIWhr1x43LRSKSS9ez/EV6wp3UHwiBbdM viOvZLfSXHt0AKpCGHzdO8YlJtegqfgLiDmNsgWwAf+XDLLol7TF+KiKVZovzEX6T8qp IeUpPBVwcVoy21EOjum5UUN4D0BBWvzuMAUoj2oTEbGZq/XmM3V9uf0H/F1lKx/8pkSK jMz8jXVjawHxs2Jl1WzTjs9Vqs/Fs4Z5BCj5m41peiNra6qhw4Q3OcSLJr2Zw2zBrmqH jnow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9DkW5uoEoUxrAMeFqmakm3WJjGOpUAJrCM6+jSD1194=; fh=UT8D4JcKUbriuelpDo6mpmWL1SujQZtI6TLcx3+AdiY=; b=RpbBRC1cm9UMbNa/gTea8wRdaK4jraFGBlV1X13UAC2Uml8VihjowA5ovA85eI61nz V1+CdfY0J0gED0POoSXe/0FZLyTHpczmhy15zRp6JHXeI62ku3A75fZ1C8jcUcEeqI4K o/lY36KplZcVULqRv3SpS66Casj6w2IsN5k1RR3XR3nMbDAtkSiOAllL0P0DQqpbbYd6 Zs3TQslIVOOGr/9PcxipSieHR6ERmujKCZKmiO4iR4DihuhCZGenz/Dbat1BJgjLEKCH 5emj5t2M4lIQr6O442pwCGf/CCZ4134+9+pIhDkvaVJYYyAYskQBSfP2a6Kx9nLqEy69 vQ5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=2erxiN+a; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-30063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30063-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c24-20020aa781d8000000b006db8f42d5d8si3546506pfn.237.2024.01.18.06.11.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:11:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20230601.gappssmtp.com header.s=20230601 header.b=2erxiN+a; arc=pass (i=1 dkim=pass dkdomain=resnulli-us.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-30063-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30063-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 757B4286BF9 for ; Thu, 18 Jan 2024 11:44:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D6D4241F7; Thu, 18 Jan 2024 11:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b="2erxiN+a" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF97024A16 for ; Thu, 18 Jan 2024 11:44:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705578251; cv=none; b=Qv1/SnEqfg5syAXrm3LoQ3Kn99REcpx6mnBXBUsWaA1eNo0+V/CYcaZ6TBPoseZ2AFz+EdUid31Oelzg7J1wC8JAHAhzFcDJpCSTqbgLrQVaJOkKcsBh75e3UbnT/KDT3Qnm4HPrcPjg3+iq5A16cXdT4qVlVNavXGBdccp1y20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705578251; c=relaxed/simple; bh=TXhzczoo35a+K5387LOUu85eARm780theDy+utDYSSc=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:Date: From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=cbXHtV/aPlR6t3r1qPJDJLsEVRrGaW4dD741qmluvqGw/rmeWJm2BJUtILMHqjTWeEx7dn8mPe1xMJRKkdCir1YbkGyPWDIxcimrSjdrkdKynTv1+Za7Q0ek6IlJb/US/Q9CSmFihJb+eLQyIH92ddMAbXTk6SH8ClCbEn6WMY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20230601.gappssmtp.com header.i=@resnulli-us.20230601.gappssmtp.com header.b=2erxiN+a; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40e775695c6so34878845e9.3 for ; Thu, 18 Jan 2024 03:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1705578248; x=1706183048; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9DkW5uoEoUxrAMeFqmakm3WJjGOpUAJrCM6+jSD1194=; b=2erxiN+a7JjJ7kproTTBLEPXwarsPSlUTBfFZj0GjVpp9FWYeJe2viziLTPuVMQLvi dP6lXKRGYwXgS5yLxU2exjMoDfBVtaOJUas52U55jZoLwi6D8bEdwtX82i+BEeNin4o0 Ujv/if/kir0tBZoUGqJPQISeoxJNx8VN/bJNQ9Fd6+tPsJh3v+jDCcdxdmpes8ig0bbz f6mIqmZaEGMr9OhLD4RXNnWUFm/3Xf3bGuE4GlP0i4d2ZvV+MsxDcfZWtM/pWVspy/T3 boUg30NcI4zZxGv/aSEJEwC1d7JOcHhkgmmATTc3gOB6kw+FrH67yOX76JnXiJ0bDzwo TmNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705578248; x=1706183048; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9DkW5uoEoUxrAMeFqmakm3WJjGOpUAJrCM6+jSD1194=; b=AahUue+N5ZLNDm3vyJr+Kgi8Whnyomhcj3KcBMmc02bxxqtOdZq6zO/H82oSj3D5+W NmoHSiCFcJBv+6cOF5xwbVBg2kCEUDR66jL8ua40JzDujqcyAy5MYtu1R/4slYvVExV2 v4KtryEWxRnpjfhEYqxBGe+cLZnyEejnHw5en9H2IkuABu86BYFJYX4sRoGTq06D16TK IVd+e9Sg3Tn5sNgSlSpuWZ1p76r7tuGLxGQYCdjsu+VOn27pdjmXXjYQV+397pO8/Svj /P1lIjAq6dYY7PpBX6esegMdAFQ4U9PTjC6FND2m8hXR6XdP54RU4CpvpY1ABMmiCB53 sPNw== X-Gm-Message-State: AOJu0YwO/lOl7y/Puea1GQ0x4NZCrAHl9iML7X3+Sq/lLY3LqYbvi48R vsCPEkUWemvTHjEIslA3uYbZFn1M4Kz/jVtEOKKRI9Fx706tZKpwteJuHznY6xQ= X-Received: by 2002:a1c:7c0a:0:b0:40e:66cf:81a9 with SMTP id x10-20020a1c7c0a000000b0040e66cf81a9mr477315wmc.111.1705578247918; Thu, 18 Jan 2024 03:44:07 -0800 (PST) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id u21-20020a05600c139500b0040e4a7a7ca3sm25610137wmf.43.2024.01.18.03.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 03:44:07 -0800 (PST) Date: Thu, 18 Jan 2024 12:44:06 +0100 From: Jiri Pirko To: Arkadiusz Kubalewski Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev, davem@davemloft.net, milena.olech@intel.com, linux-kernel@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org, mschmidt@redhat.com, Jan Glaza , Przemek Kitszel Subject: Re: [PATCH net v5 2/4] dpll: fix pin dump crash for rebound module Message-ID: References: <20240118110719.567117-1-arkadiusz.kubalewski@intel.com> <20240118110719.567117-3-arkadiusz.kubalewski@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240118110719.567117-3-arkadiusz.kubalewski@intel.com> Thu, Jan 18, 2024 at 12:07:17PM CET, arkadiusz.kubalewski@intel.com wrote: [...] >@@ -443,7 +490,9 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module, > ret = -EINVAL; > goto err_pin_prop; > } >- pin->prop = prop; >+ ret = dpll_pin_prop_dup(prop, &pin->prop); >+ if (ret) >+ goto err_pin_prop; > refcount_set(&pin->refcount, 1); > xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC); > xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC); You are missing dpll_pin_prop_free() call on error path. It should go right above "err_pin_prop:" line. Haste makes waste.. pw-bot: cr >@@ -515,6 +564,7 @@ void dpll_pin_put(struct dpll_pin *pin) > xa_destroy(&pin->dpll_refs); > xa_destroy(&pin->parent_refs); > xa_erase(&dpll_pin_xa, pin->id); >+ dpll_pin_prop_free(&pin->prop); To be symmetric with dpll_pin_alloc() order, xa_erase() should be called first here and xa_destroys() in different order. But that is a material for net-next. > kfree(pin); > } > mutex_unlock(&dpll_lock); [...]