From patchwork Thu Jan 14 07:11:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 59708 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3830873lbb; Wed, 13 Jan 2016 23:13:49 -0800 (PST) X-Received: by 10.66.120.77 with SMTP id la13mr3784198pab.74.1452755629470; Wed, 13 Jan 2016 23:13:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si7498184pas.128.2016.01.13.23.13.48; Wed, 13 Jan 2016 23:13:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbcANHNo (ORCPT + 29 others); Thu, 14 Jan 2016 02:13:44 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:38474 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbcANHNj (ORCPT ); Thu, 14 Jan 2016 02:13:39 -0500 Received: by mail-wm0-f43.google.com with SMTP id b14so411954862wmb.1 for ; Wed, 13 Jan 2016 23:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9HSLL4YJUaaHfmQ4+JCQ5axhgdYlZhCh6tKXBDNI0t8=; b=PcDMqkCV4slNab6Q7ZOlI/4ukZgDF+jz9w8e/eeWEwvjZa+ORIU+oV2ig+spe55dM2 rMW8Hfr3QpJEK6+9GsOg8Nw4yzWjzvQDA+c9Px6oI94o3upL+w7FwMJcUAAcaN3hxlRq hvJhAx2uRBaTt95+G8lPi3Nhfzv4iT7tzeBAs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9HSLL4YJUaaHfmQ4+JCQ5axhgdYlZhCh6tKXBDNI0t8=; b=HTJ4yz8agEHLG+5chEsBffHBwZ6y2PgreaIBk1ZO+1EkB34NH2Yaae8CHuGDazrb4I Vo0zGQEmpDxSJIjrKUmFtcDvBea/AxlRdD5r9wDDMKvVSYo4lL4icVom5squ6rTsgFf+ pVeUcgMp/pzmlkyRvzZtOFuBYrczBiapRIWdpD38y70Sn8Qjvv9JshJWmrAxFqWRq6eW MbfguRSc1Rds1g/QlZBU35mKFNpbkFpqT39TMZsfsbXnEgIxQ1j2wcTCMrqGGIulqYjO Hct/8fq1oFOMPEk3qMTm420ldMnnKwzvyK2zIeudVglls+bRplxOpvgvc6dIKLY31sMz iGVA== X-Gm-Message-State: ALoCoQny0wBGhLfVmYdSC9sFBG3fU3av1QNc3bAJ/Z1JB6Ld2VF70lmhLFwTQbGubMRi63cga6ddwP8+QHSYBwXowfrZeqMiEQ== X-Received: by 10.194.203.228 with SMTP id kt4mr2244455wjc.58.1452755618219; Wed, 13 Jan 2016 23:13:38 -0800 (PST) Received: from localhost.localdomain ([217.46.108.250]) by smtp.gmail.com with ESMTPSA id c185sm23828522wma.5.2016.01.13.23.13.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 23:13:37 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, maxime.coquelin@st.com, jassisinghbrar@gmail.com, dan.carpenter@oracle.com, seraphin.bonnaffe@st.com, Lee Jones Subject: [PATCH 1/4] mailbox: mailbox-test: Use more consistent format for calling copy_from_user() Date: Thu, 14 Jan 2016 07:11:26 +0000 Message-Id: <1452755489-18736-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452755489-18736-1-git-send-email-lee.jones@linaro.org> References: <1452755489-18736-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While we're at it, ensure copy-to location is NULL'ed in the error path. Suggested-by: Dan Carpenter Signed-off-by: Lee Jones --- drivers/mailbox/mailbox-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c index 684ae17..7d9b915 100644 --- a/drivers/mailbox/mailbox-test.c +++ b/drivers/mailbox/mailbox-test.c @@ -63,9 +63,9 @@ static ssize_t mbox_test_signal_write(struct file *filp, if (!tdev->signal) return -ENOMEM; - ret = copy_from_user(tdev->signal, userbuf, count); - if (ret) { + if (copy_from_user(tdev->signal, userbuf, count)) { kfree(tdev->signal); + tdev->signal = NULL; return -EFAULT; }