[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e3d7a227-8915-5c00-cd34-fe2db7fc7121@I-love.SAKURA.ne.jp>
Date: Sun, 22 Mar 2020 09:31:21 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Waiman Long <longman@...hat.com>
Cc: David Howells <dhowells@...hat.com>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
James Morris <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
Mimi Zohar <zohar@...ux.ibm.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, keyrings@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-integrity@...r.kernel.org, netdev@...r.kernel.org,
linux-afs@...ts.infradead.org, Sumit Garg <sumit.garg@...aro.org>,
Jerry Snitselaar <jsnitsel@...hat.com>,
Roberto Sassu <roberto.sassu@...wei.com>,
Eric Biggers <ebiggers@...gle.com>,
Chris von Recklinghausen <crecklin@...hat.com>
Subject: Re: [PATCH v7 2/2] KEYS: Avoid false positive ENOMEM error on key
read
On 2020/03/22 3:49, Waiman Long wrote:
> + do {
> + if (ret > key_data_len) {
> + if (unlikely(key_data))
> + __kvzfree(key_data, key_data_len);
> + key_data_len = ret;
> + continue; /* Allocate buffer */
Excuse me, but "continue;" inside "do { ... } while (0);" means "break;"
because "while (0)" is evaluated before continuing the loop.
----------
#include <stdio.h>
int main(int argc, char *argv[])
{
do {
printf("step 1\n");
if (1) {
printf("step 2\n");
continue;
}
printf("step 3\n");
} while (0);
printf("step 4\n");
return 0;
}
----------
----------
step 1
step 2
step 4
----------
> + }
> + } while (0);
Powered by blists - more mailing lists