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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48880C433EF for ; Sat, 16 Apr 2022 19:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ozLnfpXWIwlHst9tdHPrskBeWhavkKRd0iP3OXdCgCk=; b=P4zNYBJi876dUp BX9xKMtFvjtTtKBE1RbdL2mepgFo/PuhgO1BvewHa04xgxpYAWMGeMKmHWMFGZMixzpKqupd+cxn5 n8HnTW/Y30NSn+J12d1Fys4auKXqqY63qn9DjduYFoZBIqFXNuO9j4/2PHkO/P+ZS/SIpmOEm6erN aKi45jodLPOtyTO+WKTsf8M0lJ/+7lSt/B3ClwbQqjkyOnxOQDxzsDM/Br3SauXv4SSlLzv8VVNcQ vmqN9pR9jDcfrZkukPuS97H0BzY4QhDpUufthTt0Gtu0v/+z+Z+8w0SbdPtsi3uI1O8rIVTDBlbPU ev13q30YT3ns97mMxtLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfoGR-00DR5e-Gp; Sat, 16 Apr 2022 19:39:23 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfoGN-00DR37-PF for linux-arm-kernel@lists.infradead.org; Sat, 16 Apr 2022 19:39:21 +0000 Received: by mail-pg1-x52f.google.com with SMTP id t4so12023648pgc.1 for ; Sat, 16 Apr 2022 12:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=voxZ31qFlafqYv1KtZJxqTUhs3UryZT4D28XGScW+a0=; b=TvlBjYUb6jvPOj6IsHs0M9D5K2wvs0b2TjFENcykUyDcKNPhtWD7iiraagCgqnJXfu X+jWY3fdoRuNHTcyuhmbSM4+oTmU5ijesNoWgO69Hbbtr7J7eWUHkK0UDPlx1PL0WIQ7 ctE0EbnqX3CCOG03pvoofNEdEaIrccBASxSjLWufJk1+DLF69pfywyReEZfxiL11dMra Ps8v6vgJ15q9TfbBLnIDgOoZ8gkJMqSOOG18LFapmNk8lSO6ei6E8GlHG+yaa1dFz/Pd UIr07HeEO/b981RrT/3upCExQJ5heif2jOckyrNIwVRqXEc4tNrKiEzZmnXwq18NRSK+ hKug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=voxZ31qFlafqYv1KtZJxqTUhs3UryZT4D28XGScW+a0=; b=VY+Y2nKeEAXdmhcDD6e6r4GFXTpsDo1pbKr94kmFMTNOsjG/6NoV2UvdvB7RxcuBKO cOI4DMXyYxm+Q3gcVow1+WlGFot62SyzMu6iU9beq/8GVPVtPTUtx+ONXvAu2hD71MQc MBddyZ5j0HsFMRYx3rHRhF5oSRs6VXId57xlGHglKKB4jl7rapOO7eLpwxJBS/txBDrQ jAAYAOQZp7uXtTbZGGa2R8qTQa+qk5fhytlJ6QFxz925YxDBR023HLaM9xW3/SJNEfaC B/MInOc27RQmqJfA5WotxQzudb9zFYiKtM+YGB/9NIfino/5ADh+FmfsqCK6/JLNhKfR NdrQ== X-Gm-Message-State: AOAM531PPR5sctURZMqIlUMybeBv51WlfqPtD3b8usjjk1s4Uxf+Q2Ho dmt0s4pwDoYoABFod8ptSS4= X-Google-Smtp-Source: ABdhPJwpJnw7UFOao4GWq7HDPD7r7/mQ3y+uk5lJFjJ5tekzMlbaH4EjnEsFU6hBsHkI+VxR4u/mGQ== X-Received: by 2002:a63:d13:0:b0:381:f043:c627 with SMTP id c19-20020a630d13000000b00381f043c627mr4027727pgl.168.1650137956942; Sat, 16 Apr 2022 12:39:16 -0700 (PDT) Received: from [192.168.1.3] (ip72-194-116-95.oc.oc.cox.net. [72.194.116.95]) by smtp.gmail.com with ESMTPSA id g200-20020a6252d1000000b0050833d7602csm6839324pfb.103.2022.04.16.12.39.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Apr 2022 12:39:16 -0700 (PDT) Message-ID: <8f140d64-e486-f02c-c9c5-09e6c740220c@gmail.com> Date: Sat, 16 Apr 2022 12:39:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH net-next v4 03/18] net: dsa: sja1105: reorder sja1105_first_entry_longer_than with memory allocation Content-Language: en-US To: Jakob Koschel , "David S. Miller" Cc: Jakub Kicinski , Paolo Abeni , Andrew Lunn , Vivien Didelot , Vladimir Oltean , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Ariel Elior , Manish Chopra , Edward Cree , Martin Habets , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Casper Andersson , Bjarni Jonasson , Christophe JAILLET , Arnd Bergmann , Colin Ian King , Eric Dumazet , Xu Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, bpf@vger.kernel.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." , Vladimir Oltean References: <20220415122947.2754662-1-jakobkoschel@gmail.com> <20220415122947.2754662-4-jakobkoschel@gmail.com> From: Florian Fainelli In-Reply-To: <20220415122947.2754662-4-jakobkoschel@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220416_123919_870770_87836E3A X-CRM114-Status: GOOD ( 10.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/15/2022 5:29 AM, Jakob Koschel wrote: > From: Vladimir Oltean > > sja1105_first_entry_longer_than() does not make use of the full struct > sja1105_gate_entry *e, just of e->interval which is set from the passed > entry_time. > > This means that if there is a gate conflict, we have allocated e for > nothing, just to free it later. Reorder the memory allocation and the > function call, to avoid that and simplify the error unwind path. > > Signed-off-by: Vladimir Oltean > Signed-off-by: Jakob Koschel Reviewed-by: Florian Fainelli -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel