Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4384005yba; Sun, 12 May 2019 11:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMqdjjpCiRyWj+oKtA8fZA3nuimV/CsIHkPrhjYL0LIX40sLCiYrIoKhhvA0JQ+UP2ECns X-Received: by 2002:aa7:92d1:: with SMTP id k17mr28859520pfa.91.1557685982851; Sun, 12 May 2019 11:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557685982; cv=none; d=google.com; s=arc-20160816; b=ihva04JNrj3mjYRWS+y2TbP9WRtfJHDDQQcdq6XEy93B1bGK2BKWJKmWRbz5UTuTnU kRbzMdFhC/X6h8tHqYclUTIo/TpZXJuu5EEdWnf5twR3kegtykI3UsNEZOMvpspp+Neg 3VnBffZWzmL5fi2W5+7IRmnCtMC3YiFKE+crXRVOA3Ot8r7/fdmOG2bZAmGEwZ556P6B +8bPX4Wj+XFLjIUgyWvTaaJI1tTT19HdOCtiiTJZ5bnKstVSnd1fH6ipSj7CGagj9Mhl T15Yye+l40rqb0ULGBgVIjGUoRTMqhDn7DgcNXHY/CvirYxcRE/orEkpvmCNMdKvP+DR jYtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization; bh=U88M69PZPEukf9gp6T0rXYwMAy/MiCx/4bgcv4g2at4=; b=VW7JZjlz91S3xkjccsXc6Tdl22c72rSYQM54sQ28B/IzSdDn+XlPsQ+LkKFkREoj2G H0e4EvXNubK39vYo4R/LVOnCDaLPFulAGuxH6vfhWEtnkW33YpOogP0W7eqNnk+NanuF fZk/fY6jB1ZPE18pqBiVta5im9xCfgosA8IthJOclZW4jWEPPM0J9PVd4BM4Ll6Q4n1Y FZhz4ktjx0zbKbYFv8Xk/FpTeLsC4rsf+oQ6UJdi4u1NRbfnNYwQdAKExtGcT62mC7kk LJiXp8mfJn8F6CHj13pONr+Su5Z+t9hmajfz9LDR3yBfmtNZ0vG4oy1+GGyq3JgHzjTM OQ7A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si15293719pfa.155.2019.05.12.11.32.46; Sun, 12 May 2019 11:33:02 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726927AbfELSKt (ORCPT + 99 others); Sun, 12 May 2019 14:10:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726529AbfELSKs (ORCPT ); Sun, 12 May 2019 14:10:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8212D81F19; Sun, 12 May 2019 18:10:48 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-61.rdu2.redhat.com [10.10.120.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7808860BCD; Sun, 12 May 2019 18:10:46 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <5CD844B0.5060206@bfs.de> References: <5CD844B0.5060206@bfs.de> <155764714099.24080.1233326575922058381.stgit@warthog.procyon.org.uk> <155764714872.24080.15171754166782593095.stgit@warthog.procyon.org.uk> To: wharms@bfs.de Cc: dhowells@redhat.com, colin.king@canonical.com, joe@perches.com, jaltman@auristor.com, linux-afs@lists.infradead.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] afs: Fix afs_xattr_get_yfs() to not try freeing an error value MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31807.1557684645.1@warthog.procyon.org.uk> Date: Sun, 12 May 2019 19:10:45 +0100 Message-ID: <31808.1557684645@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 12 May 2019 18:10:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org walter harms wrote: > > + ret = dsize; > > + if (size > 0) { > > + if (dsize > size) { > > + ret = -ERANGE; > > + goto error_key; > > } > > + memcpy(buffer, data, dsize); > > } > > > > i am confused: if size is <= 0 then the error is in dsize ? See this bit, before that hunk: > + if (ret < 0) > + goto error_key; David