From owner-svn-src-all@freebsd.org Mon Jun 24 20:23:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B24315D88A5; Mon, 24 Jun 2019 20:23:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1C787254; Mon, 24 Jun 2019 20:23:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E40806212; Mon, 24 Jun 2019 20:23:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKNJ2h053553; Mon, 24 Jun 2019 20:23:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKNJJ2053552; Mon, 24 Jun 2019 20:23:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242023.x5OKNJJ2053552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349342 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 349342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F1C787254 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:23:20 -0000 Author: imp Date: Mon Jun 24 20:23:19 2019 New Revision: 349342 URL: https://svnweb.freebsd.org/changeset/base/349342 Log: Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Jun 24 20:19:03 2019 (r349341) +++ head/sys/cam/scsi/scsi_da.c Mon Jun 24 20:23:19 2019 (r349342) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3613,16 +3616,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5294,7 +5289,6 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /*