From: Thierry Reding Subject: Re: [PATCH libdrm] freedreno: zero is a valid fd number, treat it as such Date: Tue, 14 Jul 2015 10:14:32 +0200 Message-ID: <20150714081431.GB12465@ulmo.nvidia.com> References: <1436794745-19525-1-git-send-email-emil.l.velikov@gmail.com> <1436795529-19701-1-git-send-email-emil.l.velikov@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1763678487==" Return-path: In-Reply-To: <1436795529-19701-1-git-send-email-emil.l.velikov@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov Cc: freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1763678487== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 13, 2015 at 02:52:09PM +0100, Emil Velikov wrote: > Abeit quite unlikely to get hit by this bug here, let just fix it. >=20 > v2: Correct conditional (do not call ioctl(DRM_IOCTL_PRIME_HANDLE_TO_FD) > when we already have the fd). >=20 > Cc: freedreno@lists.freedesktop.org > Cc: Rob Clark > Signed-off-by: Emil Velikov > --- > freedreno/freedreno_bo.c | 6 +++--- > freedreno/kgsl/kgsl_bo.c | 1 + > freedreno/msm/msm_bo.c | 1 + > 3 files changed, 5 insertions(+), 3 deletions(-) I think there's another one in kgsl_pipe_destroy(). With that fixed, this is: Reviewed-by: Thierry Reding There are also a couple more like this in omap_drm.c (I suspect Rob copied from that =3D) that we may want to fix at the same time (in the same patch or a separate one). There's also a few places where an fd is compared to -1 directly, which should be okay, but might be worth making consistent. I can send a patch if you're not pedantic enough. =3D) Thierry --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJVpMTkAAoJEN0jrNd/PrOh+8UQAK4yfJQGlTu2B45dGGcRl2DW p/PVVlm8dD+OohmyDBHfsWsqh9kjZ4mA3MpROYnjVvkNDwYVDCctajbF0qPNQfex 37YMxKCTo7GV+6dcj7MD9A5gACSuLj+MqQ2KVKuvbWZ5yCDeaaQnXaN3YKzIFLU2 96Q9LqdXyLN6C7RJDwdPaDVlhCwlIVdGoNq57ZTqu3H6PJY1NhMtq4CvT0GcTmKQ pFlZWHSaYQzLWNml0GaDAFUxzOwT+NH+AsO/R46VSr0dHB1VsxuHYv0m+PfF1L9i y3hgSEoIzGNdQMcwSEPWQOw8woa+CMhj9iJGSZEB3E+V4PrnfiSnBoqr3L+y2KhE 10Esizl5xzwMkZ+W7uDO50oFmy8aXVI33dL8KKAZea+HNShxjv2I7lniaOCIMi5X gzVJzk9UW/fhsFNqzh2huOw0WxPbQ7hBY4vaMbP0SdkjPeWoFDGnz6mlKBDLGFBp QudH5AubTv3dEIwZ0RJxJ9E/JKuhc/sfO7y5C29P/cZtH3MEK/xJySRNCggdwIjX y8lUnPoh12RmKLjJqCdPlxZxtwYTdfFjfXoZ1no3kqKg1H3KGUOzurgKF4rG0IA7 qYwGrPIb5pSqMtTTJGrEOcRZsH6EIh+eX0tVKP9K2N6766ci53loazmGwhDK0BB3 YlzSsHEVRdHs0buGCr0v =w2UC -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB-- --===============1763678487== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1763678487==--