public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: mbroz@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/device/dev-swap.c Date: Thu, 19 Aug 2010 23:05:00 -0000 [thread overview] Message-ID: <20100819230545.26070.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mbroz@sourceware.org 2010-08-19 23:05:45 Modified files: . : WHATS_NEW lib/device : dev-swap.c Log message: Fix file descriptor leak in swap signature detection Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1714&r2=1.1715 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-swap.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/WHATS_NEW 2010/08/19 23:04:37 1.1714 +++ LVM2/WHATS_NEW 2010/08/19 23:05:45 1.1715 @@ -2,6 +2,7 @@ ================================== Simplify MD/swap signature detection in pvcreate and allow aborting. Remove assumption that --yes must be used only in --force mode. + Fix file descriptor leak in swap signature detection error path. Version 2.02.73 - 18th August 2010 ================================== --- LVM2/lib/device/dev-swap.c 2009/03/17 14:40:00 1.1 +++ LVM2/lib/device/dev-swap.c 2010/08/19 23:05:45 1.2 @@ -42,7 +42,7 @@ { char buf[10]; uint64_t size; - int page; + int page, ret = 0; if (!dev_get_size(dev, &size)) { stack; @@ -66,11 +66,12 @@ break; if (!dev_read(dev, page - SIGNATURE_SIZE, SIGNATURE_SIZE, buf)) { - stack; - return -1; + ret = -1; + break; } if (_swap_detect_signature(buf)) { *signature = page - SIGNATURE_SIZE; + ret = 1; break; } } @@ -78,10 +79,7 @@ if (!dev_close(dev)) stack; - if (*signature) - return 1; - - return 0; + return ret; } #endif
reply other threads:[~2010-08-19 23:05 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20100819230545.26070.qmail@sourceware.org \ --to=mbroz@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).