From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424Ab2D1FGc (ORCPT ); Sat, 28 Apr 2012 01:06:32 -0400 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:45191 "EHLO mail4-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847Ab2D1FG3 (ORCPT ); Sat, 28 Apr 2012 01:06:29 -0400 X-IronPort-AV: E=Sophos;i="4.75,494,1330902000"; d="scan'208";a="141926293" Date: Sat, 28 Apr 2012 07:06:16 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: dwmw2@infradead.org cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: question about fs/jffs2/readinode.c Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function read_direntry in fs/jffs2/readinode.c contains the following code: err = jffs2_flash_read(c, (ref_offset(ref)) + read, rd->nsize - already, &read, &fd->name[already]); if (unlikely(read != rd->nsize - already) && likely(!err)) return -EIO; if (unlikely(err)) { JFFS2_ERROR("read remainder of name: error %d\n", err); jffs2_free_full_dirent(fd); return -EIO; } Is it intentional that the first if doesn't free fd? At first I thought that that might be the case, because what would be the point of having two conditionals if they are going to do the same thing. But I can't see why fd should not be freed either, so maybe the two conditionals are just there to give different error messages? thanks, julia