From owner-svn-src-stable@freebsd.org Fri Mar 24 08:06:01 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E89D1BC4A; Fri, 24 Mar 2017 08:06:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 521A61452; Fri, 24 Mar 2017 08:06:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2O860l5081819; Fri, 24 Mar 2017 08:06:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2O860Mp081818; Fri, 24 Mar 2017 08:06:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201703240806.v2O860Mp081818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Mar 2017 08:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315895 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2017 08:06:01 -0000 Author: mjg Date: Fri Mar 24 08:06:00 2017 New Revision: 315895 URL: https://svnweb.freebsd.org/changeset/base/315895 Log: MFC r305383: fd: fix up fdeget_file It was supposed to return NULL if a fp is not installed. Modified: stable/11/sys/sys/filedesc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/filedesc.h ============================================================================== --- stable/11/sys/sys/filedesc.h Fri Mar 24 07:22:32 2017 (r315894) +++ stable/11/sys/sys/filedesc.h Fri Mar 24 08:06:00 2017 (r315895) @@ -215,13 +215,18 @@ fget_locked(struct filedesc *fdp, int fd static __inline struct filedescent * fdeget_locked(struct filedesc *fdp, int fd) { + struct filedescent *fde; FILEDESC_LOCK_ASSERT(fdp); if ((u_int)fd > fdp->fd_lastfile) return (NULL); - return (&fdp->fd_ofiles[fd]); + fde = &fdp->fd_ofiles[fd]; + if (fde->fde_file == NULL) + return (NULL); + + return (fde); } static __inline bool