1 #include <stdio.h> 2 3 int *add_inode(); 4 int IS_ERR(void *); 5 main(void)6int main(void) 7 { 8 int *p; 9 10 p = add_inode(); 11 if (!IS_ERR(p)) { 12 *p = 1; 13 } 14 *p = 1; 15 16 return 0; 17 } 18 /* 19 * check-name: dereferencing ERR_PTR bugs 20 * check-command: smatch -p=kernel sm_err_ptr.c 21 * 22 * check-output-start 23 sm_err_ptr.c:14 main() error: 'p' dereferencing possible ERR_PTR() 24 * check-output-end 25 */ 26