Screen blanks often result in a NULL dereference in __ww_mutex_lock with
lock->acquired being non zero and lock->ctx NULL. mpi@ also reported
it occuring when switching from Xorg to a virtual terminal.
ok mpi@
* the `younger` process gives up all it's
* resources.
*/
- if (slow || ctx == NULL || ctx->stamp < lock->ctx->stamp) {
+ if (slow || ctx == NULL ||
+ (lock->ctx != NULL && ctx->stamp < lock->ctx->stamp)) {
int s = msleep(lock, &lock->lock,
intr ? PCATCH : 0,
ctx ? ctx->ww_class->name : "ww_mutex_lock", 0);