From patchwork Thu Jul 7 08:01:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9218103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46B0A6048B for ; Thu, 7 Jul 2016 08:02:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C3592879D for ; Thu, 7 Jul 2016 08:02:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30FDB2879F; Thu, 7 Jul 2016 08:02:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 947D02879D for ; Thu, 7 Jul 2016 08:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756269AbcGGICM (ORCPT ); Thu, 7 Jul 2016 04:02:12 -0400 Received: from prv-mh.provo.novell.com ([137.65.248.74]:32898 "EHLO prv-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbcGGICL convert rfc822-to-8bit (ORCPT ); Thu, 7 Jul 2016 04:02:11 -0400 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 07 Jul 2016 02:01:50 -0600 Message-Id: <577E288D02000078000FBF10@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Thu, 07 Jul 2016 02:01:49 -0600 From: "Jan Beulich" To: "Juergen Gross" Cc: , Subject: [PATCH] xen-scsifront: correct return value checks on xenbus_scanf() Mime-Version: 1.0 Content-Disposition: inline Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only a positive return value indicates success. Signed-off-by: Jan Beulich --- drivers/scsi/xen-scsifront.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 4.7-rc6-xenbus_scanf.orig/drivers/scsi/xen-scsifront.c +++ 4.7-rc6-xenbus_scanf/drivers/scsi/xen-scsifront.c @@ -1000,14 +1000,14 @@ static void scsifront_do_lun_hotplug(str snprintf(str, sizeof(str), "vscsi-devs/%s/state", dir[i]); err = xenbus_scanf(XBT_NIL, dev->otherend, str, "%u", &device_state); - if (XENBUS_EXIST_ERR(err)) + if (err <= 0) continue; /* virtual SCSI device */ snprintf(str, sizeof(str), "vscsi-devs/%s/v-dev", dir[i]); err = xenbus_scanf(XBT_NIL, dev->otherend, str, "%u:%u:%u:%u", &hst, &chn, &tgt, &lun); - if (XENBUS_EXIST_ERR(err)) + if (err != 4) continue; /*