From: Sage Weil Date: Thu, 25 Oct 2012 15:49:41 +0000 (-0700) Subject: libceph: avoid NULL kref_put from NULL alloc_msg return X-Git-Tag: v3.8-rc1~21^2~60 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7246240c7c186542f73af4fadc744d66440f616f;p=pandora-kernel.git libceph: avoid NULL kref_put from NULL alloc_msg return The ceph_on_in_msg_alloc() method calls the ->alloc_msg() helper which may return NULL. It also drops con->mutex while it allocates a message, which means that the connection state may change (e.g., get closed). If that happens, we clean up and bail out. Avoid calling ceph_msg_put() on a NULL return value and triggering a crash. This was observed when an ->alloc_msg() call races with a timeout that resends a zillion messages and resets the connection, and ->alloc_msg() returns NULL (because the request was resent to another target). Fixes http://tracker.newdream.net/issues/3342 Signed-off-by: Sage Weil Reviewed-by: Alex Elder --- Reading git-diff-tree failed