Thread (5 messages) 5 messages, 2 authors, 2020-03-22

Re: [PATCH v7 2/2] KEYS: Avoid false positive ENOMEM error on key read

From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: 2020-03-22 00:32:22
Also in: keyrings, linux-integrity, linux-security-module, lkml

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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help