Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1143498lqs; Wed, 6 Mar 2024 07:31:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVvUeaAmhhoM3lqq2UtqD6GQRoK3ijqQ4J8SxObcBdSqBlCcxH3ZZzt3YLgB6Qg8+uDi3V15RUIWMdMPisBXwBfrw3AIfo1X26BM96vCQ== X-Google-Smtp-Source: AGHT+IGn7bO4IG3wWnZ1QiHJPJTIzrDDM4TNXkX8DC7rFeegFq/mzTC0CgmHFEgucaKWGXuRvbh1 X-Received: by 2002:a05:6a20:3d08:b0:1a1:67c7:3ba4 with SMTP id y8-20020a056a203d0800b001a167c73ba4mr1863771pzi.51.1709739088975; Wed, 06 Mar 2024 07:31:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709739088; cv=pass; d=google.com; s=arc-20160816; b=Jd0yGZjo6KGFzkXBMi/PFn7cHte/SaGNY6sjYxwlh38DQ+HIhE1TAtYbkv4sGLusJ/ BuaEpicqp3f02tqA3pP4aJqBPGS31CptP1VzkpyhDGLxqUHknnjhqsa7wwWM4Q/tN/Cs 3DGYpGnWN89c39bDq7YcKj4NfozWCUwwQ5f62DZs14pVJ6oReVnA0ymZFu1HMpvPwV6J 6EjvLKk7JexNqrcL7ObG/ApEOhtWkVO+LQ6Ll3GF1/jr23jdrF6SdqW6p4L3uP+9ZiCE XcJWoGHC8xyz6LIQblqKbx3oSsGj+F6Vhbbi0c/QUusbgPDZyZ6M5mfJZfLOObUPLXjf +8Dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=thread-index:thread-topic:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature :dkim-filter; bh=s2MDr7WOywlnh3ZAqvGnB0f57zkYihv9+BGZBbec/V0=; fh=RvrXj/tCQt/+1nTVyKA1UPgWyZt9USvFtQQz2mA2awE=; b=wtr8L9D9aprUoCA7W+RtDd9ILzNMaE453e/whMeiDHd2EEtIWnv9aqsTes0tnrAK1V MwQRGKoPvcnQBvv12l1MiTdNDHET+CkNIX0v7N7WFM787ISClv9YFbe5efcrVVXw/9A7 Y4Y3I/WqP/jOJPrekipdHrMsqnl4Hw1TtbvZ1i2aQis7VpzXGoS8VEAMV/HFlXlNW9My 2O3/o3W5vS1+CC+50Owvc+cL8G7APr0PvtDBGJSn/Z8GgKzzEdGvzv5sIuLcwXf2L2ZX wnvKLhNHya930nZAuGPWhxriQ5QQQkhbDx+Q0yxJNtxSo8mn/RyrjcI6cAKRKHomzbpb uB9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rosalinux.ru header.s=1D4BB666-A0F1-11EB-A1A2-F53579C7F503 header.b=UrWWlrbW; arc=pass (i=1 spf=pass spfdomain=rosalinux.ru dkim=pass dkdomain=rosalinux.ru dmarc=pass fromdomain=rosalinux.ru); spf=pass (google.com: domain of linux-kernel+bounces-94154-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rosalinux.ru Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g1-20020aa78741000000b006e37410162bsi11883988pfo.56.2024.03.06.07.31.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 07:31:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94154-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@rosalinux.ru header.s=1D4BB666-A0F1-11EB-A1A2-F53579C7F503 header.b=UrWWlrbW; arc=pass (i=1 spf=pass spfdomain=rosalinux.ru dkim=pass dkdomain=rosalinux.ru dmarc=pass fromdomain=rosalinux.ru); spf=pass (google.com: domain of linux-kernel+bounces-94154-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rosalinux.ru 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C953BB2232D for ; Wed, 6 Mar 2024 15:29:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BA331350EF; Wed, 6 Mar 2024 15:29:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rosalinux.ru header.i=@rosalinux.ru header.b="UrWWlrbW" Received: from mail.rosalinux.ru (mail.rosalinux.ru [195.19.76.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 837BA12FF88 for ; Wed, 6 Mar 2024 15:29:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.19.76.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709738975; cv=none; b=av1QG4OJemXcedtWx5IaZ1tofTmWd+l3EZ9eKPsas3nvVeGz2iIhcPSRzI1NYaPGLkykDLsSXVQvVkfTTOzFmIaL7Npk6nyndJfF1GZ2IlSWETmCTuTZ9naD0qzHvdD4RnHHOkJQ917UGKIWhQwbu6TnWdTOVzLRqMsNCQcO67Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709738975; c=relaxed/simple; bh=C3Sx1OdAp4WBlmh0QlBwjLKQijGxkG87lxhH+y5+Gwg=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=SLAKpJOEq9BphzxA0hUodmXyiGUHVP/h6hji8H262bASgqRLq3aqKqbMxlQhwRJh25z9oB7YbnJ+QrKEUEXnIWYWEllXUED3ait7hV8Ewn9pSfWkITfK48T9IPaXb9G3OUHaAYdLMFTC/l0CTlLMvPq8211UY9Hn69X68fPgpdo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rosalinux.ru; spf=pass smtp.mailfrom=rosalinux.ru; dkim=pass (2048-bit key) header.d=rosalinux.ru header.i=@rosalinux.ru header.b=UrWWlrbW; arc=none smtp.client-ip=195.19.76.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rosalinux.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rosalinux.ru Received: from localhost (localhost [127.0.0.1]) by mail.rosalinux.ru (Postfix) with ESMTP id C0B0DD9A062B0; Wed, 6 Mar 2024 18:29:18 +0300 (MSK) Received: from mail.rosalinux.ru ([127.0.0.1]) by localhost (mail.rosalinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id h34VE-gmfcRS; Wed, 6 Mar 2024 18:29:18 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.rosalinux.ru (Postfix) with ESMTP id 8D6B2D9A062AE; Wed, 6 Mar 2024 18:29:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rosalinux.ru 8D6B2D9A062AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rosalinux.ru; s=1D4BB666-A0F1-11EB-A1A2-F53579C7F503; t=1709738958; bh=s2MDr7WOywlnh3ZAqvGnB0f57zkYihv9+BGZBbec/V0=; h=Date:From:To:Message-ID:MIME-Version; b=UrWWlrbWKlytDmLbBBNNhl+k6fSFAIvdRV2gP7OZCgpLaPjwXRM448CNRUpgvF+MG MEv+wD6NtY9q1zqEyFTKMiKATrPBH5mGxqSOLs3nZFLijUY119OGY0L4QG5sOWuBEg 4qZpcoVVZAB7GkRh85KXFSYGY1nTb0hIEGTNjfqyDLujq6meOa8G8oMvSTDGYyuKv1 OV32qZ/xX3UN9QICY/mASUt5m1PQXZHS6O9p9Tsyt3PDRG+lPZo017rm58UpOsWqU0 9G3g788SDktPgsPLrY7cG+18Jkeq3YQxHJdO1NLbGu7yUQXyyuITTd5NPA1PV2KMMl tYkpJh4imxopQ== X-Virus-Scanned: amavisd-new at rosalinux.ru Received: from mail.rosalinux.ru ([127.0.0.1]) by localhost (mail.rosalinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SV61K1I6DtiF; Wed, 6 Mar 2024 18:29:18 +0300 (MSK) Received: from mail.rosalinux.ru (mail.rosalinux.ru [195.19.76.54]) by mail.rosalinux.ru (Postfix) with ESMTP id 577D8D9A062B0; Wed, 6 Mar 2024 18:29:18 +0300 (MSK) Date: Wed, 6 Mar 2024 18:29:18 +0300 (MSK) From: =?utf-8?B?0JzQuNGF0LDQuNC7INCb0L7QsdCw0L3QvtCy?= To: Rui Miguel Silva Cc: linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, greybus-dev@lists.linaro.org Message-ID: <263695481.5978842.1709738958259.JavaMail.zimbra@rosalinux.ru> In-Reply-To: References: <20240301190425.120605-1-m.lobanov@rosalinux.ru> Subject: Re: [PATCH] greybus: Fix deref of NULL in __gb_lights_flash_brightness_set 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=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.8.12_GA_3803 (ZimbraWebClient - GC120 (Win)/8.8.12_GA_3794) Thread-Topic: greybus: Fix deref of NULL in __gb_lights_flash_brightness_set Thread-Index: aWEJxOWeV+AJ+gus/QAqbWALvD0cYw== Hi Rui, if you can, please prepare a patch with my reported-by tag. Thanks! Yours sincerely, Mikhail! >Hi Mikhail, >Mikhail Lobanov writes: > > >Are you sending a new version with the changes suggested in this thread? >or do you want me to prepare something with your reported-by tag? > >Cheers, > Rui > --- > drivers/staging/greybus/light.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c > index 87d36948c610..929514350947 100644 > --- a/drivers/staging/greybus/light.c > +++ b/drivers/staging/greybus/light.c > @@ -148,10 +148,15 @@ static int __gb_lights_flash_brightness_set(struct gb_channel *channel) > GB_CHANNEL_MODE_TORCH); > > /* For not flash we need to convert brightness to intensity */ > - intensity = channel->intensity_uA.min + > + > + if (channel) { > + intensity = channel->intensity_uA.min + > (channel->intensity_uA.step * channel->led->brightness); > > - return __gb_lights_flash_intensity_set(channel, intensity); > + return __gb_lights_flash_intensity_set(channel, intensity); > + } > + > + return 0; > } > #else > static struct gb_channel *get_channel_from_cdev(struct led_classdev *cdev) > -- > 2.43.0