Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3615757imm; Thu, 17 May 2018 11:36:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoV8Run30wdiqDk9xnN0q8QRNAgPJIyZssPIpz2W4Pieq44J5Jnv/C62sO45U3+9d8p42N8 X-Received: by 2002:a63:618b:: with SMTP id v133-v6mr4768449pgb.285.1526582180597; Thu, 17 May 2018 11:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526582180; cv=none; d=google.com; s=arc-20160816; b=HgEbuyiSL8smr/lYsiyjHYiM675nnF6DjFE6i+MtcTeXEaiB7aF6jTUxAcqrHBj/b/ 11Z45bBP/6WMFtxvtLsJO0PlDhSZphhgHUAxpFMuTLgi00BA3bgruhtsm32Y8smSVQP5 +97fKtWnvOqQHvChAy6HgGBpuNt8nbohz4Av9oDU97Tp8XM4IiDo2ZB/H1sqZ+c9H7J2 Ua/eAonShEonmewSco/cYlQCyJmYQamLxAx7LIex2d9d10bdTRP6CQR+RnQwRzTdHy1J 4bhZ8R/gGv6acLgKPBw49tH87xqJ9fXnsi8TscyQ6YkSi7YBVVV144ujX4LL9/Grq6j2 P6nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=Wc5G/XR0QlZoeGgKj/nWBbqsmPPSNUTfR13CkAETQrQ=; b=FliqdcVHyWOAJUWKQCJ0JW1KfgW5Dggktra84HnOra4HqshxGWz0IyHwC0mClTpALB ezsW+aH0g6Pukc4/6/Rt1CA5cBUdk7Mzo/1/cnIo+rYBf47qbwuZX2zPe04MrIWQfYjg gnYu4hk/GSkWJaV6rPNlX26O4s+Ejo6Z/s6zGu72oe/sc6Yv7Z3Ihjf8Us2mEmxLNZm5 xgGGnDBgiMDjC1RupM2NMFeyF6neQMEKrqBBhmfAeyJG3A92WaGrnIPrxppolDVogSap Nb8oXr+z2YrDHeVbsWvlZEGwYyQd08NZxEohOuZAV7P9J9Z/3g3D2F2FxO3PfxgdEXPj 465g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=RJTv0egE; dkim=pass header.i=@codeaurora.org header.s=default header.b=kUQ03FCs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si4440727pgs.349.2018.05.17.11.36.06; Thu, 17 May 2018 11:36:20 -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=@codeaurora.org header.s=default header.b=RJTv0egE; dkim=pass header.i=@codeaurora.org header.s=default header.b=kUQ03FCs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752081AbeEQSfr (ORCPT + 99 others); Thu, 17 May 2018 14:35:47 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43438 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbeEQSfq (ORCPT ); Thu, 17 May 2018 14:35:46 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 68D2860AF9; Thu, 17 May 2018 18:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526582145; bh=U9nftxLUv24iRsUPL3B/RS4V8txQ55Vq6Q7adiLd68I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RJTv0egE7RjCFiFNeU8EERDNwvEkuXCjnxVzm3vy8pFLxn3GptaVTOhCh7WeaCu77 1oBYDcSeMJUaIHrMkVK8nNRKvVHef3g4aTWKiAKzhmB6LvhVA/hCIDqs2OlcteFd4n 46B6TJHkqIJkLQlsAn3oPMwyojQCZtLh93T1MXlw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id D8346605A8; Thu, 17 May 2018 18:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526582144; bh=U9nftxLUv24iRsUPL3B/RS4V8txQ55Vq6Q7adiLd68I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kUQ03FCspY/IPBsbyrt956HAy0g/OLcTAe/1wDuCBYr89vTGMXXO5vKW8rIFIzqKe UY63m2q6H3s1azm7tfcfXWEeX+W/K5PK1Iv0DsKlm81ZDtCrFPkcn7gXfBi4xN4/5I i0UUq899K8rxJbHNOcQeh+ttlkkDvc69Cz7Aa2EU= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 17 May 2018 11:35:44 -0700 From: Jeff Johnson To: Ramon Fried Cc: kvalo@codeaurora.org, linux-kernel@vger.kernel.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Eyal Ilsar , linux-wireless-owner@vger.kernel.org Subject: Re: [PATCH] wcn36xx: Add support for Factory Test Mode (FTM) In-Reply-To: <20180517113250.16517-1-ramon.fried@linaro.org> References: <20180517113250.16517-1-ramon.fried@linaro.org> Message-ID: X-Sender: jjohnson@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-17 04:32, Ramon Fried wrote: > From: Eyal Ilsar ... > +static int wcn36xx_smd_process_ptt_msg_rsp(void *buf, size_t len, > + void **p_ptt_rsp_msg) > +{ > + struct wcn36xx_hal_process_ptt_msg_rsp_msg *rsp; > + int ret = 0; why initialize 'ret' when you immediately overwrite? > + ret = wcn36xx_smd_rsp_status_check(buf, len); ... > + if (rsp->header.len > 0) { > + *p_ptt_rsp_msg = kmalloc(rsp->header.len, GFP_ATOMIC); NULL check required? > + memcpy(*p_ptt_rsp_msg, rsp->ptt_msg, rsp->header.len); > + } > + return ret; > +} > + > +int wcn36xx_smd_process_ptt_msg(struct wcn36xx *wcn, > + struct ieee80211_vif *vif, void *ptt_msg, size_t len, > + void **ptt_rsp_msg) > +{ > + struct wcn36xx_hal_process_ptt_msg_req_msg *p_msg_body; > + int ret = 0; why initialize 'ret' when it is always overwritten before use? > + ret = wcn36xx_smd_send_and_wait(wcn, p_msg_body->header.len);