From patchwork Mon Mar 25 03:08:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kangjie Lu X-Patchwork-Id: 10867835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C563C1390 for ; Mon, 25 Mar 2019 03:08:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B085C29221 for ; Mon, 25 Mar 2019 03:08:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4D5829225; Mon, 25 Mar 2019 03:08:56 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 9A52E29221 for ; Mon, 25 Mar 2019 03:08:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729339AbfCYDIt (ORCPT ); Sun, 24 Mar 2019 23:08:49 -0400 Received: from mta-p5.oit.umn.edu ([134.84.196.205]:50502 "EHLO mta-p5.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729298AbfCYDIt (ORCPT ); Sun, 24 Mar 2019 23:08:49 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-p5.oit.umn.edu (Postfix) with ESMTP id 053A49A3 for ; Mon, 25 Mar 2019 03:08:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p5.oit.umn.edu ([127.0.0.1]) by localhost (mta-p5.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q601ydSfA5LL for ; Sun, 24 Mar 2019 22:08:47 -0500 (CDT) Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p5.oit.umn.edu (Postfix) with ESMTPS id CF594912 for ; Sun, 24 Mar 2019 22:08:47 -0500 (CDT) Received: by mail-io1-f70.google.com with SMTP id b16so6877270iot.5 for ; Sun, 24 Mar 2019 20:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Utn6p4nXLnOYm10umWeaqQUkhCCUuB5hzL6kg2hYEmM=; b=eDufYQDoYJPyELpBqbKdy6X1BZycmmqecSbFmIHGOwWPz5PXBZrFWrVGa1mmWUKpXA RL+ZY//z37BwoJlMF5crVLAjECjlTXOn7A+5MiNPdfdcC+rRBUZBlH5CFcBriv5N4GL9 orzVii7I4jr/Pv7gYacfNcNihtl/VBH/wRh3ySdaQwvg6UxyHVkprJ2VtPF3rrRM+UnQ 6WgbFpYvtzeSMdK8s1yvYnm7CGSKpH3mkoXv+lkNQ77qz+ktPk4go9Kaa6jcpu7IMz8U 1kss7fVrjS1xD+Xxa3mx2bThRgITyQSYWcLLLOvb5J70Hgzkx7Pv8dliZ+WJLPxFOhhd TAPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Utn6p4nXLnOYm10umWeaqQUkhCCUuB5hzL6kg2hYEmM=; b=IeSjQtPL9heY0hWk0ifIKcrfbpvyAqByEMzmuVSyGe+0nCxEfAVx10b1UhAofMBNuW w3hl6OQQC2cqy/TV6JswoliJeGKfmwBuV2R9NZU8PlLsp5U+IcvcmipQcLLZ7aFdDea1 tuLBPCJjqRf8hpcw5aHUqrfuOGfzM07yznmb8QiAgPmIp8fQOD46+SRXyaonYYn8VZfJ CXo4gwZFAf3PusaQVev6mkyWt/lc1SXAgc43hDVwS2WtvPctCBY+dipSP0tQBdKafIYT EbdRba9p8LCLpfpKNSUwtPQJRPuGlxpeNsAAUrd1Uk7nk55ZkuugLeokfSF5KlgqKLqD 5+yg== X-Gm-Message-State: APjAAAXrvUUih5zxHkDUUiRUSZKlVWcr/1w1Md+t++z0DjuWPahioOsW 6v0hTdp4H1WXrMkFurRat/C+gpC/ksqS3b7Vsr68ur4nJj/SkPRNBSLsif0JOx6TD68dpTKIRAz xamDHnzlsPGQr0skH9bKcpUqH X-Received: by 2002:a24:e184:: with SMTP id n126mr2277456ith.155.1553483327462; Sun, 24 Mar 2019 20:08:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw63D7THsrLkUYpPUONKKVreVq+l5pvnayYwoz3KyVVpCEC1v89KLzn80VcJBgBknZQLyCLUw== X-Received: by 2002:a24:e184:: with SMTP id n126mr2277442ith.155.1553483327182; Sun, 24 Mar 2019 20:08:47 -0700 (PDT) Received: from bee.dtc.umn.edu (cs-bee-u.cs.umn.edu. [128.101.106.63]) by smtp.gmail.com with ESMTPSA id m137sm4316394itb.27.2019.03.24.20.08.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 20:08:46 -0700 (PDT) From: Kangjie Lu To: kjlu@umn.edu Cc: pakki001@umn.edu, Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH v2] usb: sierra: fix a missing check of device_create_file Date: Sun, 24 Mar 2019 22:08:28 -0500 Message-Id: <20190325030828.14068-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190324223920.961-1-kjlu@umn.edu> References: <20190324223920.961-1-kjlu@umn.edu> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP device_create_file() could fail and return an error code. The fix captures the error and returns the error code upstream in case it indeed failed. Signed-off-by: Kangjie Lu Acked-by: Alan Stern --- drivers/usb/storage/sierra_ms.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c index 6ac60abd2e15..e605cbc3d8bf 100644 --- a/drivers/usb/storage/sierra_ms.c +++ b/drivers/usb/storage/sierra_ms.c @@ -194,8 +194,6 @@ int sierra_ms_init(struct us_data *us) kfree(swocInfo); } complete: - result = device_create_file(&us->pusb_intf->dev, &dev_attr_truinst); - - return 0; + return device_create_file(&us->pusb_intf->dev, &dev_attr_truinst); }