Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1818363pxb; Tue, 26 Oct 2021 16:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcUm63D4/ldQIeetUhynPPCEWLlgJiRxA428eik/V90E3YWKnSSEc8Z/5Ym8tBbEbrRyIq X-Received: by 2002:a05:6402:40cf:: with SMTP id z15mr39296563edb.138.1635292774903; Tue, 26 Oct 2021 16:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635292774; cv=none; d=google.com; s=arc-20160816; b=Ze5hM98cn2Xk+NtzO8srZdicK6/Idk+AKBBgIDjiwrOnAJ5ALp/K6XO9SAKE5/0MNH QAbiVCgFVr4H2DZZ/FE0hsARbip8HxbI0UximahpmCFwim7EecZxb9ZtaUlSkhz2bsx9 0+kp9bieUxz8+CCNuyuXf0SJ6QADR3+HqtIUridWEB5GGk29bebebmPM6kN49YtKSM+k GFu2W1DrvBPPjycsdTqptZmvUSpe5a55G2q00RE5iGlVdy6gi0dgpQpiz4HgVkrIHp/z ader2WZ5pSokM1e6MqtMtiTLcnkNRefk5T6/+S92NBNZ0XUesKOHqml4ZDVPZqRe6MRq /B8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=jCFIvfHpB7cFgeJcYrmYcjc+EHFxQY2WfJaJ+mVrz58=; b=MRSq2c0LAnMN89D97hZJGlOESHFhWKLz/F/N2M2cC5Y6yxsh8qPFbKWnJ2YxfpQUmg uZau9qE6Og11lIYdPRR31ftJcBnvlSlZzy2m4I7lbchS9ptB4ZvrFKM/W5onw8lU1ml0 QFS2+z1KtpXq02R+isy0wfnzc+dHieIajKnfAH07PS9zJXWDCv1GzBhl4z/UgAVDOgP1 bczEfc8aYfN0aaHKiP4ONfX8/2B/5zLQytI2r5nX8PJu/D5ZSWUQ+rfSH0F8e9a2SDN5 BR0J3qezxDqyugP3VF7/bl0tPsYFVte+SOXPHiCgG7Cbgbx6Pq4Ug7JtTOBCjs9vStMi nRiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga2si6204639ejc.670.2021.10.26.16.58.59; Tue, 26 Oct 2021 16:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235478AbhJZQ2w (ORCPT + 99 others); Tue, 26 Oct 2021 12:28:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:43960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237672AbhJZQ2l (ORCPT ); Tue, 26 Oct 2021 12:28:41 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E467A603E9; Tue, 26 Oct 2021 16:26:15 +0000 (UTC) Date: Tue, 26 Oct 2021 12:26:14 -0400 From: Steven Rostedt To: Tao Zhou Cc: Daniel Bristot de Oliveira , Ingo Molnar , Tom Zanussi , Masami Hiramatsu , Juri Lelli , Clark Williams , John Kacur , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , linux-rt-users@vger.kernel.org, linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V5 08/20] rtla: Helper functions for rtla Message-ID: <20211026122614.017844da@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Oct 2021 00:22:04 +0800 Tao Zhou wrote: > > + do { > > + retval = read(in_fd, buffer, sizeof(buffer)); > > + if (read <= 0) > > check "retval" not read. Like: > > if (retval <= 0) OUCH! Good check. Daniel, did that not produce any warnings?? -- Steve > > > + goto out_close; > > + > > + retval = write(out_fd, buffer, retval); > > + if (retval < 0) > > + goto out_close; > > + } while (retval > 0);