From patchwork Fri Jul 11 21:16:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 4537631 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 420119F333 for ; Fri, 11 Jul 2014 21:16:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FC912026C for ; Fri, 11 Jul 2014 21:16:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A33AE2021B for ; Fri, 11 Jul 2014 21:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751217AbaGKVQK (ORCPT ); Fri, 11 Jul 2014 17:16:10 -0400 Received: from fieldses.org ([174.143.236.118]:40400 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918AbaGKVQJ (ORCPT ); Fri, 11 Jul 2014 17:16:09 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1X5iAr-0003a3-DX for linux-nfs@vger.kernel.org; Fri, 11 Jul 2014 17:16:09 -0400 Date: Fri, 11 Jul 2014 17:16:09 -0400 To: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd4: handle failure to find backchannel Message-ID: <20140711211609.GA13656@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The local variable "ses" will be left NULL here in the case we fail to find a connection. Spotted by a coverity scan. Signed-off-by: J. Bruce Fields --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 2c73cae9899d..fe22cd5c42d3 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1001,14 +1001,18 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) } spin_unlock(&clp->cl_lock); + if (!c) + goto out_no_connection; err = setup_callback_client(clp, &conn, ses); - if (err) { - nfsd4_mark_cb_down(clp, err); - return; - } + if (err) + goto out_no_connection; /* Yay, the callback channel's back! Restart any callbacks: */ list_for_each_entry(cb, &clp->cl_callbacks, cb_per_client) run_nfsd4_cb(cb); + return; +out_no_connection: + nfsd4_mark_cb_down(clp, err); + return; } static void nfsd4_do_callback_rpc(struct work_struct *w)