Not sure where to report bugs, here as good as any other?
The error path causes null pointer exceptions. Something like below is needed.
--- a/logicpd-new-productid.c 2018-05-23 17:38:32.678514618 -0400
+++ b/logicpd-new-productid.c 2018-05-23 16:42:17.607646256 -0400
@@ -1399,7 +1399,6 @@
struct file *f;
mm_segment_t fs;
loff_t pos = 0;
- int ret = 0;
long sz;
struct id_header hdr;
@@ -1407,7 +1406,7 @@
f = filp_open(EEPROM_PATH, O_RDONLY, 0);
- if(f == NULL)
+ if(IS_ERR(f))
printk(KERN_ALERT "filp_open error!!.\n");
else{
fs = get_fs();
@@ -1437,9 +1436,10 @@
sz = hdr.data_length;
vfs_read(f, (void *)&id_data_buf[sizeof(hdr) + sizeof(xsums)], sz, &pos);
set_fs(fs);
- }
filp_close(f,NULL);
- return ret;
+ return 0;
+ }
+ return -1;
}
#endif