diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-11 12:04:08 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-19 07:26:23 +1000 |
commit | 63705716a44030e5d4e3bea6bd19bd28fa132635 (patch) | |
tree | 3427a2502a38715c9da56db27cb1f1563cd1e825 | |
parent | a6cdf28476062f70c1481b255e7d22d814f73440 (diff) | |
download | xf86-input-wacom-63705716a44030e5d4e3bea6bd19bd28fa132635.tar.gz |
Coverity: fix potential NULL-pointer dereferences
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
-rw-r--r-- | src/wcmCommon.c | 3 | ||||
-rw-r--r-- | src/wcmTouchFilter.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 7d56ba5..92f8cf8 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1475,6 +1475,9 @@ void wcmFreeCommon(WacomCommonPtr *ptr) { WacomCommonPtr common = *ptr; + if (!common) + return; + DBG(10, common, "common refcount dec to %d\n", common->refcnt - 1); if (--common->refcnt == 0) { diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 61e3a3a..423a893 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -360,6 +360,9 @@ static void wcmSingleFingerPress(WacomDevicePtr priv) if (!TabletHasFeature(priv->common, WCM_LCD)) return; + if (!firstChannel) + return; + if (firstInProx && !secondInProx) { firstChannel->valid.states[0].buttons |= 1; common->wcmGestureMode = GESTURE_DRAG_MODE; |