static int erofsfsck_check_inode(erofs_nid_t pnid, erofs_nid_t nid)
{
int ret, i;
- struct erofs_inode inode;
+ struct erofs_inode inode = {.sbi = &g_sbi, .nid = nid};
erofs_dbg("check inode: nid(%llu)", nid | 0ULL);
-
- inode.nid = nid;
- inode.sbi = &g_sbi;
ret = erofs_read_inode_from_disk(&inode);
if (ret) {
if (ret == -EIO)
return;
}
- vi = (struct erofs_inode *)malloc(sizeof(struct erofs_inode));
+ vi = calloc(1, sizeof(struct erofs_inode));
if (!vi) {
fuse_reply_err(req, ENOMEM);
return;
int ret;
struct erofs_inode *vi;
- vi = (struct erofs_inode *)malloc(sizeof(struct erofs_inode));
+ vi = calloc(1, sizeof(struct erofs_inode));
if (!vi) {
fuse_reply_err(req, ENOMEM);
return;
struct fuse_entry_param fentry = { 0 };
struct erofsfuse_lookupdir_context ctx = { 0 };
- vi = (struct erofs_inode *)malloc(sizeof(struct erofs_inode));
+ vi = calloc(1, sizeof(struct erofs_inode));
if (!vi) {
fuse_reply_err(req, ENOMEM);
return;