mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Phillip Lougher <phillip@squashfs.org.uk>
To: linux-kernel@vger.kernel.org
Cc: minchan@kernel.org, Phillip Lougher <phillip@squashfs.org.uk>
Subject: [PATCH 4/4] Squashfs: Check stream is not NULL in decompressor_multi.c
Date: Thu, 14 Nov 2013 05:14:19 +0000	[thread overview]
Message-ID: <1384406059-28567-5-git-send-email-phillip@squashfs.org.uk> (raw)
In-Reply-To: <1384406059-28567-1-git-send-email-phillip@squashfs.org.uk>

Fix static checker complaint that stream is not checked in
squashfs_decompressor_destroy().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
---
 fs/squashfs/decompressor_multi.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/squashfs/decompressor_multi.c b/fs/squashfs/decompressor_multi.c
index ae54675..d6008a6 100644
--- a/fs/squashfs/decompressor_multi.c
+++ b/fs/squashfs/decompressor_multi.c
@@ -119,11 +119,10 @@ void squashfs_decompressor_destroy(struct squashfs_sb_info *msblk)
 			kfree(decomp_strm);
 			stream->avail_decomp--;
 		}
+		WARN_ON(stream->avail_decomp);
+		kfree(stream->comp_opts);
+		kfree(stream);
 	}
-
-	WARN_ON(stream->avail_decomp);
-	kfree(stream->comp_opts);
-	kfree(stream);
 }
 
 
-- 
1.7.10.4


  parent reply	other threads:[~2013-11-14  5:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14  5:14 [PATCH 0/4] Squashfs: performance improvement patches (V3) Phillip Lougher
2013-11-14  5:14 ` [PATCH 1/4] Squashfs: Refactor decompressor interface and code (V3) Phillip Lougher
2013-11-19  8:07   ` Minchan Kim
2013-11-14  5:14 ` [PATCH 2/4] Squashfs: Generalise paging handling in the decompressors (V3) Phillip Lougher
2013-11-19  8:10   ` Minchan Kim
2013-11-14  5:14 ` [PATCH 3/4] Squashfs: Directly decompress into the page cache for file data (V3) Phillip Lougher
2013-11-19  8:17   ` Minchan Kim
2013-11-14  5:14 ` Phillip Lougher [this message]
2013-11-19  8:18   ` [PATCH 4/4] Squashfs: Check stream is not NULL in decompressor_multi.c Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384406059-28567-5-git-send-email-phillip@squashfs.org.uk \
    --to=phillip@squashfs.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®