[PATCH] xf86/modes: Defang stale pointers when copying modes
Keith Packard
keithp at keithp.com
Wed May 30 14:25:40 PDT 2012
Chris Wilson <chris at chris-wilson.co.uk> writes:
> +extern _X_EXPORT void
> +xf86InternMode(DisplayModePtr intern, const DisplayModeRec * pMode);
The name doesn't seem very descriptive to me -- what is 'Intern'
supposed to mean?
> /**
> + * Fills in a copy of mode, removing all stale pointer references.
> + */
> +void
> +xf86InternMode(DisplayModePtr intern, const DisplayModeRec *mode)
> +{
> + *intern = *mode;
> + intern->prev = intern->next = NULL;
> + intern->name = NULL;
> +}
What should be done with ->Private? If this mode was ever actually handed
to a driver, it might not be NULL...
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120530/338c2dc5/attachment.pgp>
More information about the xorg-devel
mailing list