Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3104946imb; Tue, 5 Mar 2019 00:41:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwXJ2DxykOem1Nhi4nyrlXUawTZ1W6zQeKCMDP0p8peSKTF+iDgz6LbxekzgqA8t9pbzde3 X-Received: by 2002:a17:902:3124:: with SMTP id w33mr30648plb.43.1551775281234; Tue, 05 Mar 2019 00:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551775281; cv=none; d=google.com; s=arc-20160816; b=ttMMfB4DbbqL7NQg8ZN4FmowSYjteUC9rs9vq4mNPQQQ7hwckmWBUI0J9riON0LtSM ldY9wREuyPLvIhaen+J02CdnpH76QvWNHFIoF32M0dtRDiuejyXRAwX3wNfKrEvKBq7f AOpIH/izUeAWIG4puwAOvDF7WvA1CZS52PyxQFm5NY+JpnwBor1kjPxoLcz9bCBR35Al 9HtMBSaQPdj86OwTpaCmTdZ0jhP+vPr169hRIuY9sVWNCw3Bt11aWe0CA0C2cCgmaLPP V/p594gb+0IhHUum8DMvzQtcBZhQvwe+kcZ0et5/SrukZhuIek5bdI2ajJQRaLqaPr61 cwyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=yenxM1KHEOaUzkNWsEW3RfBPXAcIH6jtrNaR/UemryI=; b=Ezrp3PFRq+FuqIOmcrUSjrrVaQqxEZDKkFhmul8qFzDucWF6oFjbZ6S8X+tp8jbxA9 6p/asVBhutBZpw/sCv8JyfBkbwcahmLf3OjhBtjs33B5PhwJPwDj2qy1CDNYE+qByBke /K/wuhpiu4jGD9MDp2dedDw2ag0XbmdRsgF3DELFGg9+sImY55DLdbpxVcAiqTJhiyQ6 +VJUcKxUmFph4iNASkNxHEQPLFGhVnXmnJyHBEv7xyI6F+pBp77+CR7lqmp19YL2cv1h u9Q+jKSASPhHTar6L/h4dn9Y2H9FmqFOm1CD9z6KVzn+pE+hbWgYmK3VcbaG7+f7hNBh K8AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j27si7663090pgm.305.2019.03.05.00.41.04; Tue, 05 Mar 2019 00:41:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbfCEIkm (ORCPT + 99 others); Tue, 5 Mar 2019 03:40:42 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:42770 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbfCEIkm (ORCPT ); Tue, 5 Mar 2019 03:40:42 -0500 Received: by mail-qt1-f193.google.com with SMTP id u7so8164997qtg.9; Tue, 05 Mar 2019 00:40:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yenxM1KHEOaUzkNWsEW3RfBPXAcIH6jtrNaR/UemryI=; b=oghEYFCQzu+MiKuIjGm0V/Rx0I9IcLiIGpHBhdKVDcgwCZsL9pXInRgjVCWHT65ahp CczjBfuo//NJtwq3Q7GbNYtc7ndtBhiu3SUT2fIL8w5CUOPBaDdmgIaet4vpbl1FcTC3 W+w5adSCDuMBeik0dHImGzv74ikuKeCzIIx/7kATcHStlVNUutPcLuralPF8tzLK/mSu Eb6c43F1208smwMZ03t+MsOmg2NBlkCaokKoCpAPHoOHoRPMHbOl8wY3Po7knFNmfTrF loP+w1YzCw83edArpWSEXR/NeUxpVSINJ7hiU0wePwpUa11qBGShc2CyXOLE0l5kbR/a hO9g== X-Gm-Message-State: APjAAAVQtPhrRGcsHgCSguGPZeelwhcfHZ4Eb2TYyTWR9k6AnCxBVoHH 1pr89EaWKvZLLV84ErgVs0FahEIx8XyeeUAYWlo= X-Received: by 2002:ac8:3251:: with SMTP id y17mr584822qta.152.1551775241213; Tue, 05 Mar 2019 00:40:41 -0800 (PST) MIME-Version: 1.0 References: <20190304202758.1802417-1-arnd@arndb.de> <20190305075317.4t32uyyhzftuoebp@kekkonen.localdomain> In-Reply-To: <20190305075317.4t32uyyhzftuoebp@kekkonen.localdomain> From: Arnd Bergmann Date: Tue, 5 Mar 2019 09:40:24 +0100 Message-ID: Subject: Re: [PATCH] media: staging/intel-ipu3: reduce kernel stack usage To: Sakari Ailus Cc: "Cao, Bingbu" , Mauro Carvalho Chehab , Greg Kroah-Hartman , "Zhi, Yong" , "linux-media@vger.kernel.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 8:53 AM Sakari Ailus wrote: > On Tue, Mar 05, 2019 at 12:25:18AM +0000, Cao, Bingbu wrote: > > > struct v4l2_pix_format_mplane *const in = > > > &q[IPU3_CSS_QUEUE_IN].fmt.mpix; > > > struct v4l2_pix_format_mplane *const out = @@ -1753,6 +1754,11 @@ > > > int imgu_css_fmt_try(struct imgu_css *css, > > > &q[IPU3_CSS_QUEUE_VF].fmt.mpix; > > > int i, s, ret; > > > > > > + if (!q) { > > > + ret = -ENOMEM; > > > + goto out; > > > + } > > [Cao, Bingbu] > > The goto here is wrong, you can just report an error, and I prefer it is next to the alloc. > > I agree, the goto is just not needed. Should I remove all the gotos then and do an explicit kfree() in each error path? I'd prefer not to mix the two styles, as that can lead to subtle mistakes when the code is refactored again. Arnd