Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] fix create_write_pipe() error check

The return value of create_write_pipe()/create_read_pipe() should be
checked by IS_ERR().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Akinobu Mita and committed by
Linus Torvalds
3cce4856 967bf623

+4 -4
+4 -4
kernel/kmod.c
··· 307 307 return 0; 308 308 309 309 f = create_write_pipe(); 310 - if (!f) 311 - return -ENOMEM; 310 + if (IS_ERR(f)) 311 + return PTR_ERR(f); 312 312 *filp = f; 313 313 314 314 f = create_read_pipe(f); 315 - if (!f) { 315 + if (IS_ERR(f)) { 316 316 free_write_pipe(*filp); 317 - return -ENOMEM; 317 + return PTR_ERR(f); 318 318 } 319 319 sub_info.stdin = f; 320 320