[PATCH 09/15] xkb: Don't check for NULL when pointer can't be NULL

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 27 16:08:09 PDT 2010


On Tue, Jul 27, 2010 at 03:09:50PM +0300, Pauli Nieminen wrote:
> Caller quarantines that pAction pointer is valid.

         ^^ "guarantees"?

same applies here as well as for the other patch, it's not the caller
guaranteeing that pAction is non-NULL, it's that we dereferernce it later
unconditionally anyway, so a NULL argument is already invalid.

Cheers,
  Peter

> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
> ---
>  xkb/xkbActions.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
> index eea3d4a..ddab882 100644
> --- a/xkb/xkbActions.c
> +++ b/xkb/xkbActions.c
> @@ -340,7 +340,7 @@ _XkbFilterLockState(	XkbSrvInfoPtr	xkbi,
>  			unsigned	keycode,
>  			XkbAction *	pAction)
>  {
> -    if (pAction&&(pAction->type==XkbSA_LockGroup)) {
> +    if (pAction->type==XkbSA_LockGroup) {
>  	if (pAction->group.flags&XkbSA_GroupAbsolute)
>  	     xkbi->state.locked_group= XkbSAGroup(&pAction->group);
>  	else xkbi->state.locked_group+= XkbSAGroup(&pAction->group);
> -- 
> 1.6.3.3
> 


More information about the xorg-devel mailing list