From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78AD1C7EE22 for ; Tue, 9 May 2023 13:07:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F31D85021; Tue, 9 May 2023 15:07:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="AYrTignR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8620B847C1; Tue, 9 May 2023 15:07:21 +0200 (CEST) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3528985021 for ; Tue, 9 May 2023 15:07:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ralph.siemsen@linaro.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-76c5673330eso68762139f.2 for ; Tue, 09 May 2023 06:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683637638; x=1686229638; 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=J+JxEf1SvIUt8HPKkBEfGYhmxbD2AtOjh3hPOEMRpSk=; b=AYrTignRtn70qAKcG99j5AW0wOB5Bod3x9KTpIBp4Wx98mu3fY2KmUPLKAhqswOYbs sDP5lWksFFPca1nzR1QlVTIQvcUsBi6yxqu6/P34UyoujVPRrlqSlboxZTUsSEg0pLas ToR12kZSYCjsGPF9a9H0Fbmtz9qyswJ7ENEzIk1vdP0PnTLuylM4pSJ0LxtdWe7LofbS yLWICndkTlPmeUXTz6KUdDxvb9sakGYPb2ygFGIKl5z5Q96sXTDZu3ar0i7eIuPOEb9r 9kwokQBw1TgtcuykLl1ECEQSM6dONRuB0ac4iArxs3uOzQETXL5pr0LmXM8S+C22/C1g 2Vvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683637638; x=1686229638; 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=J+JxEf1SvIUt8HPKkBEfGYhmxbD2AtOjh3hPOEMRpSk=; b=iyjdr87ok5S4h2ITrQQvSWCl7qHqUIGsIiXLCVJuPTNYNlC8+G3V2hAumJel/M3Zdf bWz0jkUVJDJ4595ozIBblqmkTL4BYc1S0um0j+6feA/HdNiLbHPmYtk/ZyjE2aBaK/MB 5dejDhUxLnTEg8HPjT7SmMedk5dqxCrUiIkqwzHwXbfNj1+wg9C7+88eZDPCHi3IqN7E 6koCWHinCYm9GPw3yBcFdOswzqHKoz/x77RJq28wj0Oa5CYbwKtVnD99EuWql21Wkpbg HFWAkEUzqn4J/IhY756876KAEdghh++SmHhkyB41wGPdUe6S81zMSWcSFquQkqvYIj7M +Szw== X-Gm-Message-State: AC+VfDxzSJo4xhZTEuzIgM/WmuqaLYyiRACJw8opoXTtmwsV+hRs/TQu ut29Z7W8RvDJ06UDtmqxnPGcvA== X-Google-Smtp-Source: ACHHUZ46He6MVvyjJWpX713JFb9SrMDp8Cs1YZtGN66J6RTjiGRecsplAC20iT0kn8eMle9PZWzkPg== X-Received: by 2002:a92:c04d:0:b0:331:3fe4:f2ec with SMTP id o13-20020a92c04d000000b003313fe4f2ecmr9453034ilf.26.1683637637823; Tue, 09 May 2023 06:07:17 -0700 (PDT) Received: from localhost (rfs.netwinder.org. [206.248.184.2]) by smtp.gmail.com with ESMTPSA id ck8-20020a0566383f0800b004090c67f155sm2730055jab.91.2023.05.09.06.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 06:07:17 -0700 (PDT) Date: Tue, 9 May 2023 09:07:16 -0400 From: Ralph Siemsen To: Marek Vasut Cc: u-boot@lists.denx.de, Simon Glass , Heiko Thiery , Heinrich Schuchardt , Ilias Apalodimas , Marc Kleine-Budde , Massimo Pegorer , Mattijs Korpershoek , Max Krummenacher , Pali =?iso-8859-1?Q?Roh=E1r?= , Roman Kopytin , Safae Ouajih , Sean Anderson , Steven Lawrance , Sughosh Ganu , Weijie Gao Subject: Re: [PATCH v5 09/10] tools: spkgimage: add Renesas SPKG format Message-ID: <20230509130716.GA3431193@maple.netwinder.org> References: <20230424011515.1359255-1-ralph.siemsen@linaro.org> <20230424011515.1359255-10-ralph.siemsen@linaro.org> <97434886-26e1-d607-a7c1-7de6280f7d5a@mailbox.org> <20230508175001.GA3380022@maple.netwinder.org> <80767553-7b0a-8ec4-f6c4-3b72cda767c5@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <80767553-7b0a-8ec4-f6c4-3b72cda767c5@mailbox.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Tue, May 09, 2023 at 04:25:06AM +0200, Marek Vasut wrote: > >The usual fail path handling like: > >" >if (there is an error) > goto exit; >... > >exit: > free(data); > return ret; >" > >does not work here ? Yes, this would handle de-allocation in the failing case. However in the normal case (no error), there is no corresponding call to free(). And there is no good place to put such a call, given the API of the callbacks. It would be possible call free() from print_header, however this is brittle since it relies on mkimage core calling print_header as the last step (and only once). Ralph