Twas brillig at 08:48:07 04.06.2010 UTC-07 when [email protected] did gyre and gimble:
AC> Move malloc after ioctl, so we don't have to worry about free'ing the AC> memory if the ioctl fails. AC> [ This bug was found by the Parfait bug checking tool. AC> For more information see http://research.sun.com/projects/parfait ] AC> Signed-off-by: Alan Coopersmith <[email protected]> Reviewed-by: Mikhail Gusarov <[email protected]> AC> - if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { AC> + if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) { AC> xf86DrvMsg(screenNum, X_ERROR, AC> - "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); AC> + "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n", AC> + strerror(errno)); AC> return NULL; AC> } AC> AC> - if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) { AC> + if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { AC> xf86DrvMsg(screenNum, X_ERROR, AC> - "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n", AC> - strerror(errno)); AC> + "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); AC> return NULL; AC> } diff(1) did the really amazing job here :) -- http://fossarchy.blogspot.com/
pgpB6F65vOS1H.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
