From patchwork Sun Aug 18 09:39:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 171569 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1586524ily; Sun, 18 Aug 2019 02:39:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJcAuXB0MDOvlIYObEYE9j9bVZqyQ5nPR8Jg2CgdA+6Lugf8EcSlhFpKYsb3EuGUO5a7sf X-Received: by 2002:a17:90a:17e2:: with SMTP id q89mr15676281pja.8.1566121181831; Sun, 18 Aug 2019 02:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566121181; cv=none; d=google.com; s=arc-20160816; b=0wPltweQjexOjbmC2F0dmRmCIVyB3s+JNMRcRUV5KmGvVyi7eaA2v5Rq8mKZG5wDBt U62xvOg2dRgsIgy89pHE5kL+wLHaeL19gKOlrhExtFfqUcUgpDG8pG5przqs/i1sjbvD ylw7Skd+2Qgl7ct0CO2XpMqqsHoEmrn69Zvv9Yiz0P6Y/0YFCUu7Z3rPD9R7x544RRjw cjf2uLcJNTNtHEqJVunMsGfp4AYcDdRPsrIbo2b0DwnrZBVtBCUvUj6XCBXgaP3FQ5SI SKLTtREAtlfC5Wfad1CbvC5u/ol1bEbnRR1mAJdmJIQXqGifpSPouOEtopDoCK8+46cF o0TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LxvxKTPsHiH7UyfUtgY+QrOf6MaZaGNFhraZnj8cu+w=; b=VHW7UvDtF7V+T4Dhkd9T4b1T7yI/24/6DCjsh/df0vJ/yCHVRNGbo+hZIOvke3NMFp oY4iJTbV0oFKLxo1NcH1e5g0N4pyC86QIjxdgPbL/UWSpK5bFq2SMIEe+s+kTMwlajbt GRDtCg+ylbqi1MQH9ix7smcmvheA0pfEXiLvxC3ihbiLB+0IxSKdOshQC6F1KkaqXndX WWnZIUtWoAp6ttqCfVe8DHhx667vIU6RfW2ZtBi01nZxAEyrhS/rRJ9tOwStUfDteBjp +Flj17gJ078mRfvBeCw1qkphNUH2LyRGpEpBE7YsZeYWV+IDbH1PhRf8DYPL47DAC+jh 3W8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kBpAVqCh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186si8027837pfd.44.2019.08.18.02.39.41; Sun, 18 Aug 2019 02:39:41 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=kBpAVqCh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbfHRJjh (ORCPT + 28 others); Sun, 18 Aug 2019 05:39:37 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46449 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbfHRJjf (ORCPT ); Sun, 18 Aug 2019 05:39:35 -0400 Received: by mail-wr1-f67.google.com with SMTP id z1so5624174wru.13 for ; Sun, 18 Aug 2019 02:39:33 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=LxvxKTPsHiH7UyfUtgY+QrOf6MaZaGNFhraZnj8cu+w=; b=kBpAVqChwEj7CrYLYsV9bO+MmvHHN4/ns32u8ZjkZBg5oUYPHdHEQ5tBdamPXCnYO6 unlnqHRujP58MV9zddJB+YEFtAEKlDwbDUlWCC3cAJIKWyHfcYRcYjziJBeWOuRUXnQ8 MvSUSy6HG3IUSojO7yDeFwM9W7gLEG8P5iy7szskAyTiUHAROVUxd54QsrkMhri/rJyR 1s+1AXo/+qfUofTP3inpaMP9QiQS3Ed9S7/DXxg+dI1cBlRyksJ6/hWun8S5cInaEztp P2KC/8Qlm8787ff17y3K8Oc+7Ods1Ss6qhEzCGv83jLAOtVqziL48K2CHEO89XNXdzBN uwHw== 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:mime-version:content-transfer-encoding; bh=LxvxKTPsHiH7UyfUtgY+QrOf6MaZaGNFhraZnj8cu+w=; b=O2eSNSjfkXVPJSZ6ysEeTOl49qU8IZnd+sl9w4JDX1DgpJ9bagCtlsqlImyhq0KMZl MnTGHSkOTtXlhf6LlQJGcpM7DgMqq5LPCUZHNDW3RX8SKzuVl+naX98O49/ZQ2/Q7p8A NRhNYMe3vKEIj5n52oUE5xyMtq2IOv03t8C6dgmQkaBp/7qYf0iLTbufBbgUt7oysBBU qEoPiQWefpletmA/0Dg6PBzhrkc+SFFpIVhshWFdVk8132YlUuKxpT4GjhIz8fu+7oIK n+CpNQcjdMvnc5BcKh7Pph0dbpl0YOA/g8igO/Dx7s+tbxb4Zcsf8NkQH0YvLwvgGgNj BnOw== X-Gm-Message-State: APjAAAXCdcVQt3gMEVVa2MkkQx7KdINTQxMogbAXHk/0JtaPbx1ODCrC u4K/nHh5Yp5rw9ZadGGPrv8LCg== X-Received: by 2002:a5d:4ecb:: with SMTP id s11mr12491768wrv.323.1566121173145; Sun, 18 Aug 2019 02:39:33 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id q3sm11520190wma.48.2019.08.18.02.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 02:39:32 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Nishka Dasgupta , Bjorn Andersson , Srinivas Kandagatla Subject: [PATCH 1/2] slimbus: qcom-ngd-ctrl: Add of_node_put() before return Date: Sun, 18 Aug 2019 10:39:01 +0100 Message-Id: <20190818093902.29993-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190818093902.29993-1-srinivas.kandagatla@linaro.org> References: <20190818093902.29993-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nishka Dasgupta Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Reviewed-by: Bjorn Andersson Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/qcom-ngd-ctrl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index f3585777324c..29fbab55c3b3 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1338,12 +1338,15 @@ static int of_qcom_slim_ngd_register(struct device *parent, continue; ngd = kzalloc(sizeof(*ngd), GFP_KERNEL); - if (!ngd) + if (!ngd) { + of_node_put(node); return -ENOMEM; + } ngd->pdev = platform_device_alloc(QCOM_SLIM_NGD_DRV_NAME, id); if (!ngd->pdev) { kfree(ngd); + of_node_put(node); return -ENOMEM; } ngd->id = id; From patchwork Sun Aug 18 09:39:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 171570 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1586530ily; Sun, 18 Aug 2019 02:39:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2E2HXkDxuaviv/PSFFWC5coRMAS3gSS/bAtVj7RMe2Sy4irEiWcef+K0QujSTJ5e+LZ1J X-Received: by 2002:a17:90a:29c5:: with SMTP id h63mr14856979pjd.83.1566121182328; Sun, 18 Aug 2019 02:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566121182; cv=none; d=google.com; s=arc-20160816; b=wVqIH8O8qllVPSY4fXyAbtp2gi44c4RG2xOfxPz8RGvqJuxqYvLkX/d6/DTuvY6yUe 79GB4OzuSs9ye8TuCEwUiy6WvCUdHrs22/s7xzMZ6w7X1ivOMnY09yAGnQ2EdGhjhVin z9izJakhyibF/Rs/vXy8TxJ5ggo2c8YcSWrdxxldyq+QemvLM2oIfKIlDLGM2/tksL8g IIB2+SbATX7DDWXBeuw8Cl9LWnwznGINyIcsKX4yNKTsNyOVGjJ6gO+LLTsZ6fbOb6rU cFK+g31n07cKUzQ88kAkh51sI9xsIUyA4YyjvlcVlJVc27zaPZI8lrYdkZgnuIJ9vLm3 2Dfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rg3pEHV16wLjiiBOFWW/dTYF5vTRUDPNa6t2gdjPdGA=; b=tDKeNZwzfctUmnDPcHX6Sa4K5AdIy6WKhrQvaVc8/+xldKoTC3vd8CE8nZxHWvG0Qi U5a/yPtVp0IEGisqCIR59joWtQzTiY9ODZQkGCYAYs7MEfJ36dcv2V0KFxekITgDmJ1b okqHtDhoQKFtvaHBmIQpws8XUHEP1fDmhA5bHlr+JV/toqOjQjYy96m1k6qrBilxC6mY 7IAOw4mCkYPsMs/RAB0t0wI9Fte66GerzTRg+IWCuKZT3ZUj9T/18f04XDZYk2vs5t3f eQpfXDlBiBb4odWZn2WN31xQUilDIvCLByCLFphpn0Rj/ya4VLYedkPH4yRquRdxfICM UC1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NLu0z+7H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186si8027837pfd.44.2019.08.18.02.39.41; Sun, 18 Aug 2019 02:39:42 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=NLu0z+7H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbfHRJjk (ORCPT + 28 others); Sun, 18 Aug 2019 05:39:40 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46448 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfHRJjg (ORCPT ); Sun, 18 Aug 2019 05:39:36 -0400 Received: by mail-wr1-f65.google.com with SMTP id z1so5624193wru.13 for ; Sun, 18 Aug 2019 02:39:34 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=rg3pEHV16wLjiiBOFWW/dTYF5vTRUDPNa6t2gdjPdGA=; b=NLu0z+7HcZtQ5E/s2TTT31YxW33bhq1OM6Jbn8gx3N6vVZwa6dV4GKgtJWpYE0Y8iX Af7LE5YSYR3HLIhEPcNhrrbx/ZeYeA+Ky2BsRfIA0B7kftnROmGUKYJjw0LY2dtNPdPD o7yubU76uZV1dOK1xkST5Uw6FzxbOOJ/ABOBdtzeRudaiyU5gx1AzhQwgeQSgNdAXqi/ lFikJQUjoy+meao7yFKMUH5UNphdINmKUEDo1Lli3jNj1ziUx3ZDkyzQibzEVZX6rXvZ PQYgfFPH7rSRfSy/YqB4f6seeNtwV9mameJ0yZg/mxdwCteA0mq/UctNlO0I43G16zk5 EBLQ== 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:mime-version:content-transfer-encoding; bh=rg3pEHV16wLjiiBOFWW/dTYF5vTRUDPNa6t2gdjPdGA=; b=GM2rFUaicdBeiC5mXjPEL4SAHiycvd0mPKagZydKIeqLTVHLjt3Mj7QytqDB2Zyhjj L1A6xTt8qLgK8mxitR12G5e43+Ukh20+r4PdbM1WJYd0MskZCzSNzVx7ir0PKUOer+aI V4dybACFZuR5R8rj0DXgNCfO02vvD1xQnMEZO+XG/Twk+pYTeIV3y9Hc2sNSNslKFHX6 RJ+M4xU1GqAQGGr+qKbCXpO0F+lJauy0Y1cCGt/PKkxbmPuUHQ5ah/MeeHugi/cyZ1/Q vHkMRSnK4gg0h7PeMwDUxP/wLi1+9OIqVeprs9uNBc0ZtDOlpZjf6/8HnXV5GfPxF/Tl E1Nw== X-Gm-Message-State: APjAAAUwjuWpq4vlA2BpfzBg1vduTBiLBZq5tMypnQXt3DOhd97m46j8 sP2SLIpAu4lyZpGPhEPAjqVH1A== X-Received: by 2002:a5d:62c1:: with SMTP id o1mr20366778wrv.293.1566121173997; Sun, 18 Aug 2019 02:39:33 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id q3sm11520190wma.48.2019.08.18.02.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 02:39:33 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Srinivas Kandagatla , Hariprasad Kelam Subject: [PATCH 2/2] slimbus: fix slim_tid_txn() Date: Sun, 18 Aug 2019 10:39:02 +0100 Message-Id: <20190818093902.29993-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190818093902.29993-1-srinivas.kandagatla@linaro.org> References: <20190818093902.29993-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix below issue reported by coccicheck ./drivers/slimbus/slimbus.h:440:3-46: duplicated argument to && or || Looks like this was a typo, SLIM_MSG_MC_REQUEST_CHANGE_VALUE is command which requires transaction ID, so fix it, this also fix the warning. Reported-by: Hariprasad Kelam Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/slimbus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index 9be41089edde..b2f013bfe42e 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -439,7 +439,7 @@ static inline bool slim_tid_txn(u8 mt, u8 mc) (mc == SLIM_MSG_MC_REQUEST_INFORMATION || mc == SLIM_MSG_MC_REQUEST_CLEAR_INFORMATION || mc == SLIM_MSG_MC_REQUEST_VALUE || - mc == SLIM_MSG_MC_REQUEST_CLEAR_INFORMATION)); + mc == SLIM_MSG_MC_REQUEST_CHANGE_VALUE)); } static inline bool slim_ec_txn(u8 mt, u8 mc)