Date: Tue, 29 Nov 2016 08:12:18 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309277 - stable/11/sys/fs/udf Message-ID: <201611290812.uAT8CIJW040093@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Nov 29 08:12:18 2016 New Revision: 309277 URL: https://svnweb.freebsd.org/changeset/base/309277 Log: MFC r308995: Do not dereference bp after bread(9) on error. Modified: stable/11/sys/fs/udf/udf_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/11/sys/fs/udf/udf_vnops.c Tue Nov 29 04:32:14 2016 (r309276) +++ stable/11/sys/fs/udf/udf_vnops.c Tue Nov 29 08:12:18 2016 (r309277) @@ -487,11 +487,11 @@ udf_read(struct vop_read_args *ap) } else { error = bread(vp, lbn, size, NOCRED, &bp); } - n = min(n, size - bp->b_resid); - if (error) { + if (error != 0) { brelse(bp); return (error); } + n = min(n, size - bp->b_resid); error = uiomove(bp->b_data + on, (int)n, uio); brelse(bp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611290812.uAT8CIJW040093>