From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 AF17B8F5B for ; Mon, 29 Apr 2024 10:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714386784; cv=none; b=uS3rHFqqgFCjuuctvHdxv8donXuoZt4Kf28aAqv9/6KN3TB1ipQZjfOApeWjukvLwxAcArha8suooBj4nIGFUrfMBq6KIo86Rm0FSdR1yT4yDqlIgw51pznikv7hXbswoDyoAykcgvMhMNp5Aw9mSpr6NFd85C+gLsWMbyyXdcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714386784; c=relaxed/simple; bh=z0Ip73Oq7JlEyErkx4LsdMIFywya1Q4jKa7bAbSZeD8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dFkyl2d30N3kCvTv6uJeeZnvs9Ifkc1CVIZBVlV5aV1mSpawa51uEL7ZNhQSfiCS9goaK+jtequp6FMwMpVgydKAD4Xhc/2YcTx56FuBVr76MHTGWS7q996M36nQX6EvmMJqc9lXLb/lrlfSMGydOTFE0IXEbhY/vMAsjcVwlRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DtnhMIe7; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DtnhMIe7" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-571be483ccaso5048636a12.2 for ; Mon, 29 Apr 2024 03:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714386781; x=1714991581; 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=GOU5F1NGvFs0bAJKPOpovNJQxbGpDe7agzDlwsoZt9I=; b=DtnhMIe7FJKb+tph/I4TU/8q+JbOiWAirJVRIgu7tUz+M57hdZXKrURpJkkDouEkH7 2ROGRwJ0k72KM4diSg1g16P8HFFOcrp11sGHhI2/vfzva/LGFVjv13u66sH6fJKY7KNk Z5S41n8OJA40uzv19kwefRj26hNSu2XZfPwEMI/RUAqYi27SpShvgNrQYYpuzfZO5s7x ExN+pbSzCimffWW+HfAZrHIgG3e4KR3ZSGhUV23Tz4RFDRUZha571dk2kfJ5cl20Bdj8 Snr4EF1dqNbmM3i+V0aNTWGClMtpbIkeevSgqwxPNaeciaArPLFMVHgkL2JTfhhukQx+ dWQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714386781; x=1714991581; 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=GOU5F1NGvFs0bAJKPOpovNJQxbGpDe7agzDlwsoZt9I=; b=pCrnY7fieXdNBFf7pWhGJaGDDdjGu3mw+un2jjC8EZTzdDplnZ18CiYmhncaUpXthQ YU0wLRABggHi3hlXXyFa6jwfETnZ91rvZ1b8m7fqj1C8UfAHwa36Tb+zCjfJXHj5zTBF EaIv/bATjexyv7Dvh0Nmq1CNchXzon4EXcFBfwqgqCUBP2UPwSvqaf7ZNyYq4fkCWqlI FYeNbuQuS2hSq6JeEzTzSJvgySCftFJUaLH3Za+mgox79CV2S9yQu0cCan/ugtJ9nBYJ NnXF880QNe4+xm+DzblxYo2fnq6PyK/5pVHfvCX009sll/zxMklsKkR8Noak/IZyVyFr ZhEg== X-Forwarded-Encrypted: i=1; AJvYcCVVFf5G3pDtnGuN0Q7iEqYNJc2bfGhd/R+x6oxsDoMIoKV5IVBkRiO0HQ47/T8bhoMqHeMGsLzIX0N7TeKhH8AdKz6w7PzPH2Ex X-Gm-Message-State: AOJu0YwYU6T0KmgZOB09bEXGNLYJ52E0z1aItrFEtv3jmSpWlALCIwNj 6KPYE8Zpodft2J7ok998U2hkgyhZFagTwOT5XKDE6IIrAUcQyyUL45wz88ErWIo= X-Google-Smtp-Source: AGHT+IGL1whmMFAwvGEtnLi5B9HGyCOJ5rCv/QBcu0MkZGGUULuE//bsrooaCcaofkuAPuzYaV5fYQ== X-Received: by 2002:a17:906:4788:b0:a58:849f:4d18 with SMTP id cw8-20020a170906478800b00a58849f4d18mr8300393ejc.35.1714386780784; Mon, 29 Apr 2024 03:33:00 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id z13-20020a170906434d00b00a51e5813f4fsm13950947ejm.19.2024.04.29.03.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:33:00 -0700 (PDT) Date: Mon, 29 Apr 2024 13:32:56 +0300 From: Dan Carpenter To: "Zhijian Li (Fujitsu)" Cc: "dave@stgolabs.net" , "jonathan.cameron@huawei.com" , "dave.jiang@intel.com" , "alison.schofield@intel.com" , "vishal.l.verma@intel.com" , "ira.weiny@intel.com" , "dan.j.williams@intel.com" , "linux-cxl@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] cxl/region: Fix missing put_device(region_dev) Message-ID: <856b5986-6f04-4aaa-ba35-fa5e6f3ebc2a@moroto.mountain> References: <20240429013154.368118-1-lizhijian@fujitsu.com> <20240429013154.368118-2-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-cxl@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: Btw, I assume you're doing some kind of static analysis? Looking for missing NULL checks is very tricky and I haven't found a way to do it well except for looking at failed allocations. Allocations have to be checked. There are so many other functions where we leave off the NULL check because the caller knows it can't fail. regards, dan carpenter