[Yaffs] yaffs_UnlinkWorker() code funny ?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Bob Dunlop
Date:  
To: yaffs
Old-Topics: [Yaffs] New yaffs patch-ker.sh mechanism
Subject: [Yaffs] yaffs_UnlinkWorker() code funny ?
Just a small funny I noticed. In yaffs_guts.c we have:

static int yaffs_UnlinkWorker(yaffs_Object *obj)
{

        int immediateDeletion = 0;


        if (!obj->myInode)
                immediateDeletion = 1;


        if(obj)
                yaffs_UpdateParent(obj->parent);



Now the second if (obj) make no sense, we'd have already crashed and
burned on the obj->myInode dereference.

>From the immediate context I'm guessing it should be:


    if (obj->parent)
        yaffs_UpdateParent(obj->parent);


-- 
        Bob Dunlop
        Guralp Systems Limited
        http://www.guralp.com