Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1639295rdb; Sat, 2 Dec 2023 04:07:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEv4NMv/oGONhqj1hku1VTGrc4gt77MmbK5jAFfOguBNvtQ0QUsLRrGIXzOWchHgLe8pB5A X-Received: by 2002:a05:6a21:980e:b0:185:a762:9179 with SMTP id ue14-20020a056a21980e00b00185a7629179mr1189649pzb.1.1701518867767; Sat, 02 Dec 2023 04:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701518867; cv=none; d=google.com; s=arc-20160816; b=g2ePq/sh6UdI21ZJAUa/50ki2mg9SZgBnRK7MFJvV7GsoBMPGv+Tqhr5ZwiyOqXFcp RdOyR+7MsDcGApYUdnZhc4aHQX9s8I102mvhmNvDRuYCceCuniVX8ACwT83iD5PaWp8w CSxx35EKTIU2g2bxhX8/kUgG4qvljUnlqFOFwoanoTSCIbDgAkJJ1dKmmTVPWNwIociY yhz8My4YcOpoND+4G1y67/kJ+vRsF/Jfc7cZmyTW+vFzIr83DTsNa3Rwqi5035F544kZ gROa/Jyp6DzAcdkRGOIMkWrhUDUSonXh3HHWx+7OcKMElrSRpwPRYFZZc1uC6k6K2YTy CIvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=xXHSBFRs3k5mUMRv5MwelkKc0dF1ze08zxVW08oiVlQ=; fh=R5z3XicpYsEV6rtrr2PKz9ORQrFYOkIFQizMZtcEWqw=; b=laT8LzTiQIHACgSpBv4T/sJZc9KluOCuj1PDiQVEoD/BHuCxUgdaJLkERG/wPTanB7 BQRBjlwY8WEHFPLOmFBBfVMXctj4g5R7VGlTB5284ofopJt+r6yatINOgeFSK3xSz4JX yteMTMnIR4Y6OvmrRvwC23gKIO1ZKbxBRzr6RQCS80u1GaaNd3khYbjc0TIOzi2TyRaD TfbwdsSUbse/9+qAi8KnJav+ZEBEI19qI2NPbnRviXm1pTYC+frWcdLTn+jHwsBvA4e2 D/h7yh0FyJrhTHCBKTfX0UHv3VUROe552r+oa/DiOijFvyRlZCmKmZXQ0gTfNqO3jvPJ tV4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n0oqdSdh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id x21-20020a63f715000000b005b7160263f2si4906414pgh.154.2023.12.02.04.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 04:07:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n0oqdSdh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9DF2B80C47AC; Sat, 2 Dec 2023 04:07:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbjLBMGT (ORCPT + 99 others); Sat, 2 Dec 2023 07:06:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjLBMGS (ORCPT ); Sat, 2 Dec 2023 07:06:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4C17CF for ; Sat, 2 Dec 2023 04:06:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED22AC433C9; Sat, 2 Dec 2023 12:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701518784; bh=lHADNuvaU9fEsiOx3WC4Nblcr6d09geCfLNRdzQPQKg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=n0oqdSdh08rPJOVrFYFfyx7NqsvxpRJFSodxRD3n5BtytNOgMaFMG+THMnfSMpKab Kp/eW99rJ1txx84Z9TRvY5jepIcPdIBYhSHy2We0O971TKCYzencOjWONfyw0gftFa kA64qhnbovY/3FULTRSq+IcU1OgGoz0oBA67IfdmLIwn+87P4AhFYOkPxMFajyAQ90 gEUZvNA9yzK1TjcKgFQ59V1boVyZHRD7amW4GyyWyvJhho/1VFko2WaYhwm5hFkRis M9UEaXExWI4d9QT+6Zi2SD79Q1n+82yz6kXGFHcgmZ9OYgy+7mN1uvUh/lwChMvWno tFzwa7yVoQMwQ== Message-ID: <406ec8fe-a407-446b-a368-c68e90f1249a@kernel.org> Date: Sat, 2 Dec 2023 13:06:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/5] w1: ds2433: introduce a configuration structure Content-Language: en-US To: marc.ferland@gmail.com, krzysztof.kozlowski@linaro.org Cc: gregkh@linuxfoundation.org, marc.ferland@sonatest.com, jeff.dagenais@gmail.com, rdunlap@infradead.org, linux-kernel@vger.kernel.org References: <20231130135232.191320-1-marc.ferland@sonatest.com> <20231130135232.191320-4-marc.ferland@sonatest.com> From: Krzysztof Kozlowski Autocrypt: addr=krzk@k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Kmvl3VBHIsBv0oDcsQWXqY+NaFahT0lRPjYtrTa1v3tem/ JoFzZ4B0p27K+qQCF2R96hVvuEyjzBmdq2esyE6zIqftdo4MOJho8uctOiWbwNNq2U9pPWmu 4vXVFBYIGmpyNPYzRm0QPwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmA872oFCRRflLYACgkQG5NDfTtBYpvScw/9GrqBrVLuJoJ52qBBKUBDo4E+5fU1bjt0 Gv0nh/hNJuecuRY6aemU6HOPNc2t8QHMSvwbSF+Vp9ZkOvrM36yUOufctoqON+wXrliEY0J4 ksR89ZILRRAold9Mh0YDqEJc1HmuxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <20231130135232.191320-4-marc.ferland@sonatest.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 02 Dec 2023 04:07:45 -0800 (PST) On 30/11/2023 14:52, marc.ferland@gmail.com wrote: > static int w1_f23_add_slave(struct w1_slave *sl) > { > -#ifdef CONFIG_W1_SLAVE_DS2433_CRC > struct w1_f23_data *data; > > data = kzalloc(sizeof(struct w1_f23_data), GFP_KERNEL); > if (!data) > return -ENOMEM; > + > + data->cfg = &config_f23; > + > +#ifdef CONFIG_W1_SLAVE_DS2433_CRC > + data->memory = kzalloc(data->cfg->eeprom_size, GFP_KERNEL); > + if (!data->memory) { > + kfree(data); > + return -ENOMEM; > + } > +#endif /* CONFIG_W1_SLAVE_DS2433_CRC */ > sl->family_data = data; > > -#endif /* CONFIG_W1_SLAVE_DS2433_CRC */ > return 0; > } > > static void w1_f23_remove_slave(struct w1_slave *sl) > { > + struct w1_f23_data *data = sl->family_data; > #ifdef CONFIG_W1_SLAVE_DS2433_CRC > - kfree(sl->family_data); > + kfree(data->memory); > +#endif /* CONFIG_W1_SLAVE_DS2433_CRC */ > + kfree(data); > sl->family_data = NULL; This should be before kfree(), to match w1_f23_add_slave(). You can move it now, since you store the pointer in data. > -#endif /* CONFIG_W1_SLAVE_DS2433_CRC */ > } > > static const struct w1_family_ops w1_f23_fops = { Best regards, Krzysztof